NsfwSpy / NsfwSpy.js

A JavaScript image classifier used to identify explicit/pornographic content written in TypeScript.
MIT License
40 stars 3 forks source link

TypeError: Cannot read properties of undefined (reading 'producer') #3

Closed ari-party closed 1 year ago

ari-party commented 1 year ago
$ node .
2023-07-09 16:20:01.450460: I tensorflow/core/platform/cpu_feature_guard.cc:193] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations:  AVX2
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
\node_modules\@tensorflow\tfjs-converter\dist\tf-converter.node.js:30397
        this.version = graph.versions.producer + "." + graph.versions.minConsumer;
                                      ^

TypeError: Cannot read properties of undefined (reading 'producer')
    at GraphModel.loadSync (\node_modules\@tensorflow\tfjs-converter\dist\tf-converter.node.js:30397:39)
    at \node_modules\@tensorflow\tfjs-converter\dist\tf-converter.node.js:30373:72

Node.js v18.14.2

image image image

d00ML0rDz commented 1 year ago

Hey, thanks for the issue.

It looks like your model path may be incorrect as it will be relative from the file you're running NsfwSpy from. Can you try using the following path and see if that fixes it?

const nsfwSpy = new NsfwSpy("file://./models/model.json");
ari-party commented 1 year ago

Hi yeah, that seemed to resolve the issue.