oveddan / posenet-for-installations

Provides an ideal way to use PoseNet for installations; it works offline and broadcasts poses over websocket.
Apache License 2.0
132 stars 29 forks source link

yarn download-models fails #9

Open ManjitBedi opened 5 years ago

ManjitBedi commented 5 years ago

When running the download models script, it will always fail; but not always on the same file.

yarn download-models

It appears to be a timeout issue?

events.js:183
      throw er; // Unhandled 'error' event
      ^

Error: connect ETIMEDOUT 172.217.14.240:443
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1191:14)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! posenet-offline-websocket-client@0.1.0 download-models: `node downloadModels.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the posenet-offline-websocket-client@0.1.0 download-models script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/manjitbedi/.npm/_logs/2018-11-08T22_39_22_518Z-debug.log
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

And here the contents of the log file:

0 info it worked if it ends with ok
1 verbose cli [ '/Users/manjitbedi/.nvm/versions/node/v8.12.0/bin/node',
1 verbose cli   '/Users/manjitbedi/.nvm/versions/node/v8.12.0/bin/npm',
1 verbose cli   'run',
1 verbose cli   'download-models' ]
2 info using npm@6.4.1
3 info using node@v8.12.0
4 verbose run-script [ 'predownload-models',
4 verbose run-script   'download-models',
4 verbose run-script   'postdownload-models' ]
5 info lifecycle posenet-offline-websocket-client@0.1.0~predownload-models: posenet-offline-websocket-client@0.1.0
6 info lifecycle posenet-offline-websocket-client@0.1.0~download-models: posenet-offline-websocket-client@0.1.0
7 warn lifecycle The node binary used for scripts is /var/folders/5w/trwhrx8171v14gk9l1xhjt4r0000gn/T/yarn--1541716752743-0.8445708776113601/node but npm is using /Users/manjitbedi/.nvm/versions/node/v8.12.0/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.
8 verbose lifecycle posenet-offline-websocket-client@0.1.0~download-models: unsafe-perm in lifecycle true
9 verbose lifecycle posenet-offline-websocket-client@0.1.0~download-models: PATH: /Users/manjitbedi/.nvm/versions/node/v8.12.0/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/manjitbedi/Projects/Work/onData/Reference etc./Node.js/posenet-for-installations-master/client/node_modules/.bin:/var/folders/5w/trwhrx8171v14gk9l1xhjt4r0000gn/T/yarn--1541716752743-0.8445708776113601:/Users/manjitbedi/Projects/Work/onData/Reference etc./Node.js/posenet-for-installations-master/node_modules/.bin:/Users/manjitbedi/.config/yarn/link/node_modules/.bin:/Users/manjitbedi/Projects/Work/onData/Reference etc./Node.js/posenet-for-installations-master/node_modules/.bin:/Users/manjitbedi/.config/yarn/link/node_modules/.bin:/Users/manjitbedi/.nvm/versions/node/v8.12.0/libexec/lib/node_modules/npm/bin/node-gyp-bin:/Users/manjitbedi/.nvm/versions/node/v8.12.0/lib/node_modules/npm/bin/node-gyp-bin:/Users/manjitbedi/.nvm/versions/node/v8.12.0/bin/node_modules/npm/bin/node-gyp-bin:/Users/manjitbedi/.nvm/versions/node/v8.12.0/bin:/Users/Shared/anaconda3/bin:/Users/manjitbedi/.cargo/bin:/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Developer/Marmalade/6.2/s3e/bin:/usr/local/share/dotnet:/opt/X11/bin:~/.dotnet/tools:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Applications/Xamarin Workbooks.app/Contents/SharedSupport/path-bin
10 verbose lifecycle posenet-offline-websocket-client@0.1.0~download-models: CWD: /Users/manjitbedi/Projects/Work/onData/Reference etc./Node.js/posenet-for-installations-master/client
11 silly lifecycle posenet-offline-websocket-client@0.1.0~download-models: Args: [ '-c', 'node downloadModels.js' ]
12 silly lifecycle posenet-offline-websocket-client@0.1.0~download-models: Returned: code: 1  signal: null
13 info lifecycle posenet-offline-websocket-client@0.1.0~download-models: Failed to exec download-models script
14 verbose stack Error: posenet-offline-websocket-client@0.1.0 download-models: `node downloadModels.js`
14 verbose stack Exit status 1
14 verbose stack     at EventEmitter.<anonymous> (/Users/manjitbedi/.nvm/versions/node/v8.12.0/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
14 verbose stack     at emitTwo (events.js:126:13)
14 verbose stack     at EventEmitter.emit (events.js:214:7)
14 verbose stack     at ChildProcess.<anonymous> (/Users/manjitbedi/.nvm/versions/node/v8.12.0/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
14 verbose stack     at emitTwo (events.js:126:13)
14 verbose stack     at ChildProcess.emit (events.js:214:7)
14 verbose stack     at maybeClose (internal/child_process.js:915:16)
14 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
15 verbose pkgid posenet-offline-websocket-client@0.1.0
16 verbose cwd /Users/manjitbedi/Projects/Work/onData/Reference etc./Node.js/posenet-for-installations-master/client
17 verbose Darwin 18.2.0
18 verbose argv "/Users/manjitbedi/.nvm/versions/node/v8.12.0/bin/node" "/Users/manjitbedi/.nvm/versions/node/v8.12.0/bin/npm" "run" "download-models"
19 verbose node v8.12.0
20 verbose npm  v6.4.1
21 error code ELIFECYCLE
22 error errno 1
23 error posenet-offline-websocket-client@0.1.0 download-models: `node downloadModels.js`
23 error Exit status 1
24 error Failed at the posenet-offline-websocket-client@0.1.0 download-models script.
24 error This is probably not a problem with npm. There is likely additional logging output above.
25 verbose exit [ 1, true ]
/Users/manjitbedi/.npm/_logs/2018-11-08T22_39_22_518Z-debug.log (END)
oveddan commented 5 years ago

Please disregard my previous comment. It could be a timeout issue.

oveddan commented 5 years ago

@ManjitBedi I would explore the options in https.get: https://nodejs.org/api/https.html#https_https_get_options_callback

Could you try editing the code in downloadModels.js to add a longer timeout based on that documentation?

ManjitBedi commented 5 years ago

Sure. I will try that. thanks

ManjitBedi commented 5 years ago

I tried a few ways to set an option for a timeout but the code will crash at run-time. I am quite new to programming with node & Promises.

function getFile(url) {
  console.log('downloading file at ' + url);
  return new Promise((resolve) => {

    https.get(url, {timeout: 5000}, (res) => {
      resolve(res);
    });
  });
}
ghost commented 4 years ago

Same issue here, yarn still fails at downloading models

$ node downloadModels.js downloading file at https://storage.googleapis.com/tfjs-models/weights/posenet/mobilenet_v1_101/manifest.json downloading file at https://storage.googleapis.com/tfjs-models/weights/posenet/mobilenet_v1_100/manifest.json downloading file at https://storage.googleapis.com/tfjs-models/weights/posenet/mobilenet_v1_075/manifest.json downloading file at https://storage.googleapis.com/tfjs-models/weights/posenet/mobilenet_v1_050/manifest.json events.js:287 throw er; // Unhandled 'error' event ^

Error: incorrect header check at Zlib.zlibOnError [as onerror] (zlib.js:180:17) Emitted 'error' event on Gunzip instance at: at errorOrDestroy (internal/streams/destroy.js:108:12) at Gunzip.onerror (_stream_readable.js:729:7) at Gunzip.emit (events.js:310:20) at Zlib.zlibOnError [as onerror] (zlib.js:183:8) { errno: -3, code: 'Z_DATA_ERROR' } error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

oveddan commented 4 years ago

@shiningbroccoli thanks for your interest in using this! I'm working on a v2. work paused for a while but I'm back on it - and this issue will be fixed in v2.

jsynnott commented 4 years ago

Problem still exists. Is it therefore not possible to use this at all?