tfjs-automl/demo/object_detection gives no predictions
See original GitHub issueTensorFlow.js version
Not sure… is that the same as the version of tfjs-core that is used? If I check the tfjs-automl package.json, it looks like it is using tfjs-core 1.2.8, but that seems strange as tfjs is at 2.x right? Then again if I check the commits it looks like tfjs-automl was never upgraded to 2.x?
Browser version
Does not seem relevant. Latest Chrome.
Describe the problem or feature request
Predictions always return an empty array.
The reason I cloned this repo and tried the object_detection demo is that this was exactly what I was seeing on my own model… Simply no predictions are returned, just an empty array. So I tried to replace my model with a ‘known good’ one from Google itself, but still the same result. So, thinking I might have some error in my code somewhere, I decided to try the official example in this repo, giving the same result. Empty array…
Code to reproduce the bug / link to feature request
Clone this repo (I am assuming you cloned to C:\ws\tfjs
)
In a shell window, browse to C:\ws\tfjs\tfjs-automl\demo\object_detection
yarn
C:\ws\tfjs\tfjs-automl\demo\object_detection>yarn
yarn install v1.12.3
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents@1.2.9: The platform "win32" is incompatible with this module.
info "fsevents@1.2.9" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
Done in 34.04s.
yarn watch
C:\ws\tfjs\tfjs-automl\demo\object_detection>yarn watch
yarn run v1.12.3
$ cross-env NODE_ENV=development parcel index.html --no-hmr --open
Server running at http://localhost:1234
| Building index.html...Browserslist: caniuse-lite is outdated. Please run next command `yarn upgrade`
WARNING: We noticed you're using the `useBuiltIns` option without declaring a core-js version. Currently, we assume version 2.x when no version is passed. Since this default version will likely change in future versions of Babel, we recommend explicitly setting the core-js version you are using via the `corejs` option.
You should also be sure that the version you pass to the `corejs` option matches the version specified in your `package.json`'s `dependencies` section. If it doesn't, you need to run one of the following commands:
npm install --save core-js@2 npm install --save core-js@3
yarn add core-js@2 yarn add core-js@3
/ Building index.js...Browserslist: caniuse-lite is outdated. Please run next command `yarn upgrade`
WARNING: We noticed you're using the `useBuiltIns` option without declaring a core-js version. Currently, we assume version 2.x when no version is passed. Since this default version will likely change in future versions of Babel, we recommend explicitly setting the core-js version you are using via the `corejs` option.
You should also be sure that the version you pass to the `corejs` option matches the version specified in your `package.json`'s `dependencies` section. If it doesn't, you need to run one of the following commands:
npm install --save core-js@2 npm install --save core-js@3
yarn add core-js@2 yarn add core-js@3
/ Building index.js...Browserslist: caniuse-lite is outdated. Please run next command `yarn upgrade`
WARNING: We noticed you're using the `useBuiltIns` option without declaring a core-js version. Currently, we assume version 2.x when no version is passed. Since this default version will likely change in future versions of Babel, we recommend explicitly setting the core-js version you are using via the `corejs` option.
You should also be sure that the version you pass to the `corejs` option matches the version specified in your `package.json`'s `dependencies` section. If it doesn't, you need to run one of the following commands:
npm install --save core-js@2 npm install --save core-js@3
yarn add core-js@2 yarn add core-js@3
√ Built in 13.89s.
Open your browser
Open your browser at http://localhost:1234
Empty array is returned
After you open the page, it takes a few seconds in which inference is running. After that, it should print a JSON with the returned results below the image and draw some boxes on top of the image containing the detected objects, but instead it only prints []
and draws no boxes at all.
Issue Analytics
- State:
- Created 3 years ago
- Comments:34 (12 by maintainers)
Top GitHub Comments
@tafsiri tried in windows on a loaner laptop , it works well with CPU and WebGL backend , i tried using this codepen example https://codepen.io/tafsiri/pen/zYqzaKr
Yes! It works!
@tafsiri Thank you! I have now seen working predictions on my machine for the first time. Finally I have a way forward. You really made my day buddy! I am going to implement using the CPU for now. Later on I might add some code that attempts to do predictions using the GPU and if it succeeds, switch the backend back to GPU for those devices where it works.
I have a consistently reproducing scenario now for this issue with the GPU backend, so if you want me to try out some stuff to narrow down the issue, just let me know. You can reach me at stijndewitt AT gmail DOT com.