Coder Social home page Coder Social logo

image-classifier's People

Contributors

swimauger avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

dreamfortek

image-classifier's Issues

Platform node has already been set error

Platform node has already been set. Overwriting the platform with [object Object].
(node:54463) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'whereImpl' of undefined
at Object. (/home/javi/git/node-image-classification/node_modules/@tensorflow/tfjs-backend-cpu/dist/tf-backend-cpu.node.js:134:39)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object. (/home/javi/git/node-image-classification/node_modules/tensorset/node_modules/@tensorflow/tfjs/dist/tf.node.js:25:22)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
(Use node --trace-warnings ... to show where the warning was created)
(node:54463) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:54463) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
$

Error on execution

After installing the library, any reference to the library causes the following output and error:

Platform node has already been set. Overwriting the platform with [object Object].
Platform node has already been set. Overwriting the platform with [object Object].
cpu backend was already registered. Reusing existing backend factory.
Platform node has already been set. Overwriting the platform with [object Object].
C:\Users\JoJo\Desktop\ic\yeet\node_modules\@tensorflow\tfjs-node\dist\index.js:49
    throw new Error("The Node.js native addon module (tfjs_binding.node) can not " +
    ^

Error: The Node.js native addon module (tfjs_binding.node) can not be found at path: C:\Users\JoJo\Desktop\ic\yeet\node_modules\@tensorflow\tfjs-node\lib\napi-v7\tfjs_binding.node.
Please run command 'npm rebuild @tensorflow/tfjs-node build-addon-from-source' to rebuild the native addon module.
If you have problem with building the addon module, please check https://github.com/tensorflow/tfjs/blob/master/tfjs-node/WINDOWS_TROUBLESHOOTING.md or file an issue.
    at Object.<anonymous> (C:\Users\JoJo\Desktop\ic\yeet\node_modules\@tensorflow\tfjs-node\dist\index.js:49:11)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:94:18)
    at Object.<anonymous> (C:\Users\JoJo\Desktop\ic\yeet\node_modules\image-classifier\lib\ImageClassifier.js:64:23)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)

This can be reproduced by just having the following line: const ImageClassifier = require("image-classifier");
Note that I am on a Windows 10 OS and the node/npm version is 16.8.0/7.13.0
Any help would be greatly appreciated!

Tensorset.stringify is not a function.

(node:287) UnhandledPromiseRejectionWarning: TypeError: Tensorset.stringify is not a function
at ImageClassifier.save (/home/runner/pclassify/node_modules/image-classifier/ImageClassifier.js:38:42)
at ImageClassifier.addExample (/home/runner/pclassify/node_modules/image-classifier/ImageClassifier.js:51:43)
.......

[Mac M1] Error on npm i

Hey there, currently, I get an error on installing this library with npm i

If I try with npm i --legacy-peer-deps, it does run through, but im not sure if this is the solution.

Does anyone have an idea how this could be solved?

npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR! 
npm ERR! While resolving: undefined@undefined
npm ERR! Found: @tensorflow/[email protected]
npm ERR! node_modules/@tensorflow/tfjs-core
npm ERR!   peer @tensorflow/tfjs-core@"^1.2.1" from @tensorflow-models/[email protected]
npm ERR!   node_modules/@tensorflow-models/knn-classifier
npm ERR!     @tensorflow-models/knn-classifier@"^1.2.2" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! @tensorflow-models/mobilenet@"^2.0.4" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: @tensorflow/[email protected]
npm ERR! node_modules/@tensorflow/tfjs-core
npm ERR!   peer @tensorflow/tfjs-core@"^3.1.0" from @tensorflow-models/[email protected]
npm ERR!   node_modules/@tensorflow-models/mobilenet
npm ERR!     @tensorflow-models/mobilenet@"^2.0.4" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.

My package.json:

{
  "dependencies": {
    "@tensorflow-models/knn-classifier": "^1.2.2",
    "@tensorflow-models/mobilenet": "^2.0.4",
    "@tensorflow/tfjs": "^2.0.1",
    "@tensorflow/tfjs-backend-wasm": "^3.3.0",
    "@tensorflow/tfjs-node": "^2.0.1",
    "tensorset": "^1.2.6"
  }
}

System: Mac M1 Big Sur 11.6

Node version: v14.17.6, v16.13.1 (current)
npm version: 8.0.0, 8.1.2 (current)

Problem with installing dependencis

this is the error i get:
This dependency was not found:

  • fs/promises in ./node_modules/image-classifier/lib/ImageClassifier.js

To install it, you can run: npm install --save fs/promises

When I do "npm install --save fs/promises"
I get this error:

The authenticity of host 'github.com (140.82.121.4)' can't be established.
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.

Most of the images are not working!

(node:183) UnhandledPromiseRejectionWarning: Error: Invalid TF_Status: 3
Message: Input to reshape is a tensor with 200704 values, but the requested shape requires a multiple of 150528

Some images work, others don't.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.