face-api.js
face-api.js copied to clipboard
face-api.js ERROR: Based on the provided shape, [256,128], the tensor should have 32768 values but has 29076
Hello. i have a problem with this API. I dont know why, but localhost work very well, but in production not. I uploaded the files directly to the server
The error says:
tf-core.esm.js:17 Uncaught (in promise) Error: Based on the provided shape, [256,128], the tensor should have 32768 values but has 29076
at g (tf-core.esm.js:17)
at kn (tf-core.esm.js:17)
at In (tf-core.esm.js:17)
at o (tf-core.esm.js:17)
at Ph (tf-core.esm.js:17)
at tf-core.esm.js:17
at Array.forEach (
i know this error is on side face-api.js, but i don't know how to fix. i use hostgator to server
Best Regards
Yes, I have the same issue. Works perfectly on local, but not on production.
For some reason, I think the model did not load all of the content. It should load 2MB instead of bytes.
i fixed. i changed the save file. I moved Model file to the root folder.
Sorry, i don't know if you understand me, because i'm Brazilian. LOL
I understand you just fine. I fixed it too, the model wasn't loading correctly because I misconfigure URL settings so it doesn't load the model. It's a bad error message making us think the error comes from the javascript program.
Hello, if someone got here with the same problem, in my case, it was working on local but not on hosted. So, after a long time, I've found out the problem was on the ftp transfer. We must pay atention to transfer the shard files in binary mode. I am using filezila and it was transfering the shards in text mode. Forcing it to binary solved.
Hello, if someone got here with the same problem, in my case, it was working on local but not on hosted. So, after a long time, I've found out the problem was on the ftp transfer. We must pay atention to transfer the shard files in binary mode. I am using filezila and it was transfering the shards in text mode. Forcing it to binary solved.
You are right!
Hello, if someone got here with the same problem, in my case, it was working on local but not on hosted. So, after a long time, I've found out the problem was on the ftp transfer. We must pay atention to transfer the shard files in binary mode. I am using filezila and it was transfering the shards in text mode. Forcing it to binary solved.
How to do that?
Hello, if someone got here with the same problem, in my case, it was working on local but not on hosted. So, after a long time, I've found out the problem was on the ftp transfer. We must pay atention to transfer the shard files in binary mode. I am using filezila and it was transfering the shards in text mode. Forcing it to binary solved.
How to do that?
Hello, using filezilla client, transfer> transfer type > binary
I faced same issue when I loaded models from git repository. To solve this I made archive of models and committed to git. Once I setup I extract the zip to appropriate directory.
I have the same problem with a dotnet SPA React app, deployed in AWS Elastic Beanstalk the json files are there but I get the error ' Error: Based on the provided shape, [1,1,256,24], the tensor should have 6144 values but has 4841'
Hello, if someone got here with the same problem, in my case, it was working on local but not on hosted. So, after a long time, I've found out the problem was on the ftp transfer. We must pay atention to transfer the shard files in binary mode. I am using filezila and it was transfering the shards in text mode. Forcing it to binary solved.
thanks, it's worked
Hello,
For me this issue was being caused because the shards had no extension and therefore had no MIME mapping. You can can update the shard files to .bin but you need to update the manifest.json files as well. You can also add a new MIME map for extensionless files to that which would be for binary files but that might be a bit more cumbersome: Solution found here https://github.com/justadudewhohacks/face-api.js/issues/131#issuecomment-561738466
I tried:
- zipping the files before committing to git, and using amplify build settings to unzip the files during the prebuild frontend stage.
- using wget to grab the zip file from S3, then unzipping it, bypassing transfer to git
- giving the shard files an extension and updated the respective manifest.json files.
No change. Everything works great locally, but for some reason I'm still getting this error once it's hosted...
Uncaught (in promise) Error: Based on the provided shape, [1,1,512,9], the tensor should have 4608 values but has 1288
This is a React.js project with the files located in Public/models
I tried:
- zipping the files before committing to git, and using amplify build settings to unzip the files during the prebuild frontend stage.
- using wget to grab the zip file from S3, then unzipping it, bypassing transfer to git
- giving the shard files an extension and updated the respective manifest.json files.
No change. Everything works great locally, but for some reason I'm still getting this error once it's hosted...
Uncaught (in promise) Error: Based on the provided shape, [1,1,512,9], the tensor should have 4608 values but has 1288
This is a React.js project with the files located in Public/models
Did you try adding the .bin extension to the shard files?
I tried:
- zipping the files before committing to git, and using amplify build settings to unzip the files during the prebuild frontend stage.
- using wget to grab the zip file from S3, then unzipping it, bypassing transfer to git
- giving the shard files an extension and updated the respective manifest.json files.
No change. Everything works great locally, but for some reason I'm still getting this error once it's hosted...
Uncaught (in promise) Error: Based on the provided shape, [1,1,512,9], the tensor should have 4608 values but has 1288
This is a React.js project with the files located in Public/modelsDid you try adding the .bin extension to the shard files?
I had tried adding a .shard extension, but I just tried adding the .bin (and updating the respective JSON), but unfortunately no change.
I also confirmed the file sizes of everything in "models" (both the JSON and the shards) were the same before/after build.
I solved transfering the shard files forcing the ftp transfer to use binary mode.
I tried:
- zipping the files before committing to git, and using amplify build settings to unzip the files during the prebuild frontend stage.
- using wget to grab the zip file from S3, then unzipping it, bypassing transfer to git
- giving the shard files an extension and updated the respective manifest.json files.
No change. Everything works great locally, but for some reason I'm still getting this error once it's hosted...
Uncaught (in promise) Error: Based on the provided shape, [1,1,512,9], the tensor should have 4608 values but has 1288
This is a React.js project with the files located in Public/modelsDid you try adding the .bin extension to the shard files?
I had tried adding a .shard extension, but I just tried adding the .bin (and updating the respective JSON), but unfortunately no change.
I also confirmed the file sizes of everything in "models" (both the JSON and the shards) were the same before/after build.
I'm thrilled to say I must have made a stupid mistake; a second set of eyes trying the same thing (add .shard extension, update JSON, place in unzipped S3 bucket, wget during prebuild) got it working!
Attaching my working models for the next person to find themselves here, so they don't make the same mistake.
Hello, if someone got here with the same problem, in my case, it was working on local but not on hosted. So, after a long time, I've found out the problem was on the ftp transfer. We must pay atention to transfer the shard files in binary mode. I am using filezila and it was transfering the shards in text mode. Forcing it to binary solved.
Congs.., How did you achive to find out that? :)
Hello, if someone got here with the same problem, in my case, it was working on local but not on hosted. So, after a long time, I've found out the problem was on the ftp transfer. We must pay atention to transfer the shard files in binary mode. I am using filezila and it was transfering the shards in text mode. Forcing it to binary solved.
Congs.., How did you achive to find out that? :)
Wow. I really don't remember :D
I tried:
- zipping the files before committing to git, and using amplify build settings to unzip the files during the prebuild frontend stage.
- using wget to grab the zip file from S3, then unzipping it, bypassing transfer to git
- giving the shard files an extension and updated the respective manifest.json files.
No change. Everything works great locally, but for some reason I'm still getting this error once it's hosted...
Uncaught (in promise) Error: Based on the provided shape, [1,1,512,9], the tensor should have 4608 values but has 1288
This is a React.js project with the files located in Public/modelsDid you try adding the .bin extension to the shard files?
I had tried adding a .shard extension, but I just tried adding the .bin (and updating the respective JSON), but unfortunately no change. I also confirmed the file sizes of everything in "models" (both the JSON and the shards) were the same before/after build.
I'm thrilled to say I must have made a stupid mistake; a second set of eyes trying the same thing (add .shard extension, update JSON, place in unzipped S3 bucket, wget during prebuild) got it working!
Attaching my working models for the next person to find themselves here, so they don't make the same mistake.
Hey! Can you pls share the amplify build settings. (Must sanitise...)
I tried:
- zipping the files before committing to git, and using amplify build settings to unzip the files during the prebuild frontend stage.
- using wget to grab the zip file from S3, then unzipping it, bypassing transfer to git
- giving the shard files an extension and updated the respective manifest.json files.
No change. Everything works great locally, but for some reason I'm still getting this error once it's hosted...
Uncaught (in promise) Error: Based on the provided shape, [1,1,512,9], the tensor should have 4608 values but has 1288
This is a React.js project with the files located in Public/modelsDid you try adding the .bin extension to the shard files?
I had tried adding a .shard extension, but I just tried adding the .bin (and updating the respective JSON), but unfortunately no change. I also confirmed the file sizes of everything in "models" (both the JSON and the shards) were the same before/after build.
I'm thrilled to say I must have made a stupid mistake; a second set of eyes trying the same thing (add .shard extension, update JSON, place in unzipped S3 bucket, wget during prebuild) got it working! Attaching my working models for the next person to find themselves here, so they don't make the same mistake. models.zip
Hey! Can you pls share the amplify build settings. (Must sanitise...)
These models worked perfect , thanks
i have the same problem and i don't know how to fix it,i use iis to server,even i use others working models,still not working
I solved transfering the shard files forcing the ftp transfer to use binary mode.
We have the similar avatar.
Hello, if someone got here with the same problem, in my case, it was working on local but not on hosted. So, after a long time, I've found out the problem was on the ftp transfer. We must pay atention to transfer the shard files in binary mode. I am using filezila and it was transfering the shards in text mode. Forcing it to binary solved.
How to do that?
Hello, using filezilla client, transfer> transfer type > binary
Worked for me, thanks!
- using filezilla client, transfer> transfer type > binary