Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

368
Views
TensorFlow.js - error: RangeError: la longitud en bytes de Float32Array debe ser un múltiplo de 4 cuando se extrae el modelo de Git y se ejecuta

Tema:
Creé un modelo en python usando tensorflow y luego lo convertí a tensorflow.js. Puse model.json y group1-shard1of1.bin en una carpeta llamada model dentro de mi directorio de servidor node.js. Lo llamé y funcionó. Más tarde empujé y me fusioné con github.

Más tarde saqué la rama principal y obtuve este error cuando ejecuté el código.

 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

Así es como llamé al modelo inicialmente:

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

Lo intenté :

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

Pero no funcionó.

Creo que tiene algo que ver con la forma en que almaceno mi modelo, pero no estoy seguro de cómo almacenarlo.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!