Cloned the latest code from repo _https://github.com/tensorflow/tfjs-models_
Loaded dependencies through yarn.
Build code through parcel.
Chrome Version 66.0.3359.181
When running the examples(both coco and camera example) in browser it does not work and throws error in console.
Error:
_
node_modules\@tensorflow\tfjs-core\dist\tensor.js:253 Uncaught (in promise) Error: Tensor is disposed.
at Tensor.throwIfDisposed (node_modules\@tensorflow\tfjs-core\dist\tensor.js:253)
at Tensor.div (node_modules\@tensorflow\tfjs-core\dist\tensor.js:418)
at MobileNet.predict (src\mobilenet.ts:183)
at src\posenet.ts:97
at Object.Tracking.tidy (node_modules\@tensorflow\tfjs-core\dist\tracking.js:36)
at PoseNet.predictForMultiPose (src\posenet.ts:96)
at _callee5$ (demos\coco.js:186)
at tryCatch (demos\node_modules\babel-runtime\node_modules\regenerator-runtime\runtime.js:62)
at Generator.invoke [as _invoke] (demos\node_modules\babel-runtime\node_modules\regenerator-runtime\runtime.js:296)
at Generator.prototype.(anonymous function) [as next] (http://localhost:1234/coco.35bde3de.js:216:21)
_
I have not written any custom code am just running the demo locally.
@oveddan
@ithinkiamdevesh what are the exact commands you are using to install the dependencies, build the demos, and run them?
Thanks @oveddan
I am running commands as follows:
C:\Users\dev\Desktop\test-project\tfjs-models>yarn
yarn install v1.6.0
[1/4] Resolving packages...
success Already up-to-date.
Done in 0.17s.
C:\Users\dev\Desktop\test-project\tfjs-models>cd posenet
C:\Users\dev\Desktop\test-project\tfjs-models\posenet>yarn
yarn install v1.6.0
[1/4] Resolving packages...
success Already up-to-date.
Done in 0.57s.
C:\Users\dev\Desktop\test-project\tfjs-models\posenet>cd demos
C:\Users\dev\Desktop\test-project\tfjs-models\posenet\demos>yarn
yarn install v1.6.0
[1/5] Validating package.json...
[2/5] Resolving packages...
success Already up-to-date.
Done in 0.71s.
C:\Users\dev\Desktop\test-project\tfjs-models\posenet\demos>parcel
Server running at http://localhost:1234
โ Built in 67.70s.
Then hitting http://localhost:1234 on browser.
Okay got it. This works.
C:\Users\dev\Desktop\test-project\tfjs-models>yarn
yarn install v1.6.0
[1/4] Resolving packages...
success Already up-to-date.
Done in 0.18s.
C:\Users\dev\Desktop\test-project\tfjs-models>cd posenet
C:\Users\dev\Desktop\test-project\tfjs-models\posenet>yarn
yarn install v1.6.0
[1/4] Resolving packages...
success Already up-to-date.
Done in 0.59s.
C:\Users\dev\Desktop\test-project\tfjs-models\posenet>cd demos
C:\Users\dev\Desktop\test-project\tfjs-models\posenet\demos>yarn
yarn install v1.6.0
[1/5] Validating package.json...
[2/5] Resolving packages...
success Already up-to-date.
Done in 0.71s.
C:\Users\dev\Desktop\test-project\tfjs-models\posenet\demos>_parcel build index.html_
โ Built in 3.41s.
dist\camera.e1c7bba9.js 660.77 KB 35.23s
dist\coco.f523c6d5.js 657.84 KB 35.22s
dist\coco.html 1.26 KB 9ms
dist\camera.html 1.17 KB 10ms
dist\index.html 214 B 9ms
dist\camera.ff62c52e.map 0 B 35.65s
dist\coco.fb1896b7.map 0 B 35.59s
C:\Users\dev\Desktop\test-project\tfjs-models\posenet\demos>_cd dist_
C:\Users\dev\Desktop\test-project\tfjs-models\posenet\demos\dist>_http-server_
Starting up http-server, serving ./
Available on:
http://192.168.56.1:8080
http://10.75.1.119:8080
http://192.168.43.7:8080
http://127.0.0.1:8080
Thanks @oveddan .
I get the same error, even when following the instructions by @ithinkiamdevesh.
Here is what I did:
my-computer-name:tfjs-models-master-3 myname$ yarn
yarn install v1.5.1
[1/4] ๐ Resolving packages...
[2/4] ๐ Fetching packages...
[3/4] ๐ Linking dependencies...
[4/4] ๐ Building fresh packages...
โจ Done in 0.26s.
my-computer-name:tfjs-models-master-3 myname$ cd posenet/
my-computer-name:posenet myname$ yarn
yarn install v1.5.1
[1/4] ๐ Resolving packages...
[2/4] ๐ Fetching packages...
[3/4] ๐ Linking dependencies...
[4/4] ๐ Building fresh packages...
success Saved lockfile.
โจ Done in 9.17s.
my-computer-name:posenet myname$ cd demos/
my-computer-name:demos myname$ yarn
yarn install v1.5.1
[1/5] ๐ Validating package.json...
[2/5] ๐ Resolving packages...
[3/5] ๐ Fetching packages...
[4/5] ๐ Linking dependencies...
[5/5] ๐ Building fresh packages...
โจ Done in 8.95s.
my-computer-name:demos myname$ parcel build index.html
โจ Built in 21.39s.
dist/camera.5c83e267.js โ ๏ธ 1 MB 828.00s
dist/coco.763ac556.js โ ๏ธ 1 MB 825.57s
dist/coco.html 1.26 KB 564ms
dist/camera.html 1.21 KB 595ms
dist/index.html 214 B 1.10s
dist/camera.cd5e1ebd.map 0 B 822.31s
dist/coco.1c49d8dc.map 0 B 819.88s
my-computer-name:demos myname$ cd dist
my-computer-name:dist myname$ http-server
Starting up http-server, serving ./
Available on:
http://127.0.0.1:8080
...
...
Hi @CreativeCode just curious - why are you doing the step yarn install v1.5.1 ? Also you should be starting parcel with yarn watch
I would follow the instructions for setup in the demos folder.
I'm not sure this would solve your issue but can you please try that? First remove the node_modules folders in both tfjs-models/posenet then tfjs-models/posenet/demos and try those instructions.
@oveddan I just deleted node_modules from both folders you pointed to, and ran the instructions from setup in the demos folder,
I still get Uncaught (in promise) Error: Tensor is disposed. when running
@evexoio @CreativeCode I just ran the setup instructions and have the same error. Will re-open.
If you want to get something up and running temporarily until we fix this, checkout commit b00dcd6
git checkout b00dcd6
Then follow the setup instructions again.
@oveddan thanks for the quick temporary solution! Works like a charm. Yes, I have tried with the official instructions first - my process posted above was the result of trying to imitate @ithinkiamdevesh 's solution... (I was not sure why I was doing what I was doing...)
@CreativeCode @ithinkiamdevesh @evexoio Thanks to @dsmilkov this has been fixed.
As part of this fix, The demos now import posenet directly from the public posenet npm package, instead of from ../src
This has a couple of positive side effects:
posenet folder.../src folder.To switch back to master and get the latest:
git checkout master
git pull origin master
Follow the new setup instructions.
Most helpful comment
If you want to get something up and running temporarily until we fix this, checkout commit b00dcd6
Then follow the setup instructions again.