TensorFlow.js is a new version of the popular open-source library which brings deep learning to JavaScript. Developers can now define, train, and r...
For further actions, you may consider blocking this person and/or reporting abuse
Hi James,
thanks or that really cool article and the example. Sadly i can't get it to work :(.
I am on a MacBook and it throws the following Error:
2018-08-10 15:17:12.564735: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.2 AVX AVX2 FMA
(node:5745) Warning: N-API is an experimental feature and could change at any time.
(node:5745) UnhandledPromiseRejectionWarning: Error: SOI not found
Do you have any experience of running it on a Mac? Might Docker be a solution?
Hello Jonas. I've been running it on a Mac! Looking around, it looks like this is an issue with the image you are trying to classify.
stackoverflow.com/questions/493916...
Are you using the panda test image provided in the blog post or something else?
Hi James! Thank for getting back to me. I used the panda you provided, but it seems the image was corrupted. I tried it with several other pandas and it works fine now.
Thanks again!
Good article! π Nevertheless, in the tfjs documentation I see that there is the method tf.fromPixels that creates a tf.Tensor from an image. Maybe is possible to replace it? Instead of jpeg-js library?
I'm not familiar with tensorflow.js, but I think that for matrix operations like this is performing better (with GPU) than using two nested fors. (Not sure...)
Thank you!! BTW; Very good article!
Hello Aral, tf.fromPixels can only be used in the browser I'm afraid. It extract pixels from DOM elements like video, image or canvas tags, rather than native buffers.
Thank you for that clarification! I would like to try tfjs in node.js!
Hi James,
i am a newbie to machine learning and its really cool article. This article really helped me in understanding some of the concepts. I have tried your script, it didn't work for the mentioned panda image and got to know that image is corrupted. When i tried with another "cat" image, I am getting this error: Error: browserHTTPRequest is not supported outside the web browser without a fetch polyfill.
I am not sure, why this error is coming, as we are referring the model locally. Please help.
Thanks!
Omg. This is amazing.
Thanks for the great article, I'm following the exact steps as you mentioned, but face some issues when loading the mobilenet model, I guess something might be changed. could you please share the version of the components used in your project?
BTW,
I'm using
"@tensorflow-models/mobilenet": "1.0.0",
"@tensorflow/tfjs": "1.0.1",
"@tensorflow/tfjs-node": "1.0.1",
Thanks a lot!
Hi
Very useful and interesting Article. Node.js is truly powerful and useful for developers. You have shared lots of information that makes the tasks easy.
thanks
elena
Hi
Interesting information and knowledge. Especially the attachment that you have shared, will be much helpful for me to understand the main theme of focus dimensions and use it. there are lot of C++ libraries you could wrap up under JavaScript quite easily. Node.js can be a nice gateway to such a library.
thanks
elena
Great way to show that Machine Learning and Node.js go well together!πππ
My team just completed an open-sourced Content Moderation Service built Node.js, TensorFlowJS, and ReactJS that we have been working over the past weeks. We have now released the first part of a series of three tutorials - How to create an NSFW Image Classification REST API and we would love to hear your feedback. Any comments & suggestions are more than welcome. Thanks in advance!
(Fork it on GitHub or clickπstar to support us and stay connectedπ)
node app.js model_data/model.json panda.jpg
cpu backend was already registered. Reusing existing backend
2019-11-08 13:31:40.445755: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX AVX2 FMA
(node:15585) UnhandledPromiseRejectionWarning: Error: browserHTTPRequest is not supported outside the web browser without a fetch polyfill.
at new BrowserHTTPRequest (/home/giuseppe/Software/tfjs/mobilenet/node_modules/@tensorflow/tfjs-core/dist/io/browser_http.js:46:19)
at Object.browserHTTPRequest (/home/giuseppe/Software/tfjs/mobilenet/node_modules/@tens
Excellent work, James. I'm gonna follow you around.
Thank you for sharing... I will give it a try...
as