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

271
Views
No capturado (en promesa) TypeError: d no es una función - tensorflow js

Estoy tratando de hacer una predicción con tensorflow js, pero cuando intento predecir tengo el siguiente error:

No capturado (en promesa) TypeError: d no es una función en tfjs@latest:17:162006 en tfjs@latest:17:159769 en etscopedRun (tfjs@latest:17:159898) en ettidy (tfjs@latest:17:159666) en n (tfjs@latest:17:161982) en tfjs@latest:17:162468 en etscopedRun (tfjs@latest:17:159898) en etrunKernelFunc (tfjs@latest:17:162190) en slice_ (slice.js:177: 17) en el segmento (operación.js:45:22)

Este es mi código javascript:

 <script> async function inicializar() { alert("estoy en inicialize"); document.getElementById('prediccion').addEventListener('click', () => predecir()); }; async function predecir() { alert("estoy en predecir"); //Mensaje para chequear que entre aca const modelo = await tf.loadLayersModel('trained-model/model.json'); const canvas = document.getElementById('output'); alert(canvas);// Mensaje para ver si lee canvas como elemento HTML let tensorImg = tf.browser.fromPixels(canvas).resizeNearestNeighbor([150, 150]).toFloat().expandDims(); alert("pasa esto"); //Mensaje para chequear que entre aca alert(tensorImg); //Mensaje para ver si lee el tensor de la imagen prediction = modelo.predict(tensorImg).data(); //Aca me da error!!!!! TypeError: d is not a function alert("pase hasta aca"); //Mensaje para chequear que entre aca, pero no llega var respuesta; if (prediction <= .5) { respuesta = "Gato"; } else { respuesta = "Perro"; } document.getElementById("prediccion").innerHTML = respuesta; }; inicializar() </script>

¡Gracias por tu ayuda!

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!