Questions + Error 500: Input to reshape is a tensor with 451584 values, but the requested shape has 150528
Hello,
I use NSFWJS with this docker projet: https://github.com/andresribeiro/nsfwjs-docker (by @andresribeiro)
But, when I use GIF image, I have this error:
Error 500: Input to reshape is a tensor with 451584 values, but the requested shape has 150528
Why? How can I fix this?
Questions: Currently, to test an image, I test it without worrying about its size? Does NSFWJS take care of resizing it automatically? Or do I have to do a resize myself? With ImageMagick before?
Thanks! :)
NSFWJS usually resizes the image for you. Can you supply the gif you're having trouble with?
Does the gif work on NSFWJS.com?
NSFWJS usually resizes the image for you. Can you supply the gif you're having trouble with?
Does the gif work on NSFWJS.com?
Great! Yes, I have attached 2 GIF images with this error.
Source: https://www.zupimages.net/up/1143869364.gif
Source: https://www.zupimages.net/up/880196740.gif
When I try the files on NSFWJS.com, I don't have any error. Why there is error on docker projet?
Thanks!
are you using classifyGif command? or classify?
are you using
classifyGifcommand? orclassify?
I use this projet: https://github.com/andresribeiro/nsfwjs-docker
I called the API with this CURL command line:
curl -F "content=@/images/a.gif" "http://localhost:3333/single/multipart-form"
So I don't know which function is actually called. But, there is the code here: https://github.com/andresribeiro/nsfwjs-docker/blob/main/src/getPrediction.ts
I think it's this:
const prediction = await model.classify(tfImage)