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.
JavaScript code: here
Advertisement
Answer
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