Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

366
Vistas
TensorFlow.js - error: RangeError: byte length of Float32Array should be a multiple of 4 when pulled the model from Git and running it

Issue:
I created a model in python using tensorflow, and then I converted it to tensorflow.js. I put the model.json and group1-shard1of1.bin in a folder called model inside my node.js server directory. I called upon it and it worked. I later pushed and merged to github.

Later I pulled the main branch and got this error when I ran the code.

error: RangeError: byte length of Float32Array should be a multiple of 4
    at new Float32Array (<anonymous>)
    at Object.decodeWeights (C:\Users\user\Documents\Ml\Trading\server\node_modules\@tensorflow\tfjs-core\dist\tf-core.node.js:5844:30)
    at decodeModelAndOptimizerWeights (C:\Users\user\Documents\Ml\Trading\server\node_modules\@tensorflow\tfjs-layers\dist\tf-layers.node.js:21144:30)
    at C:\Users\aelna\Documents\Ml\Trading\server\node_modules\@tensorflow\tfjs-layers\dist\tf-layers.node.js:21126:26
    at step (C:\Users\user\Documents\Ml\Trading\server\node_modules\@tensorflow\tfjs-layers\dist\tf-layers.node.js:147:27)
    at Object.next (C:\Users\user\Documents\Ml\Trading\server\node_modules\@tensorflow\tfjs-layers\dist\tf-layers.node.js:96:53)
    at fulfilled (C:\Users\user\Documents\Ml\Trading\server\node_modules\@tensorflow\tfjs-layers\dist\tf-layers.node.js:77:28)
info: Server closed

This is how I called the model initally:

    const path = 'file:///Users/user/Documents/Ml\Trading/server/src/services/model/model.json'
    const model1 = await tf.loadLayersModel(path);

I tried :

    const handler = tfn.io.fileSystem('src/services/model/model.json');
    const model1 = await tf.loadLayersModel(handler);

But it did not work.

I believe it has something to do with how I store my model, but I am unsure how to store it.

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda