Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Uncaught Error: Based on the provided shape, [1024,3], the tensor should have 3072 values but has 30

I am trying to build a Tensorflow.js app, it works all good locally, but when I hosted it (I tried Netlify and Vercel on both Firefox and Chrome) I got this error: Uncaught Error: Based on the provided shape, [1024,3], the tensor should have 3072 values but has 30. Any ideas? My only one was that it would have to do something with CORS but I don't know.

Hosted: enter image description here

Localhost: enter image description here

JavaScript code: here

like image 271
Filip Avatar asked Jan 25 '23 03:01

Filip


1 Answers

you will get such error messages if the bin file is corrupt. This can happen, for example, if you downloaded a repo from GitHub as a ZIP file, which uses Git LFS instead. To avoid that you need to clone it or download the bin file separately. In your case I assume that your website hoster does not allow the file extension .bin and you might get an error message as content of the file back. Also the download times of the json and bin are a bit surprising. Both are almost identical, although the bin file should be much bigger and therefore requires a longer download. Best regards, Sascha

like image 87
Sascha Dittmann Avatar answered Jan 30 '23 11:01

Sascha Dittmann