ECONNRESET error while trying to download posenet models in NodeJS
TensorFlow.js version: 1.2.9 -> posenet: 2.1.3
Node Version: v12.5.0
Describe the problem or feature request
I'm having problems getting a basic posenet version to run on NodeJS. I think the library tries to connect to google storage and download actual model files but it fails with ECONNRESET (Timeout)
I can download the file just fine via browser. Also tried to execute the code on two different machines with the same output.
Error log:
errno:"ECONNRESET"
message:"request to https://storage.googleapis.com/tfjs-models/savedmodel/posenet/mobilenet/float/075/model-stride16.json failed, reason: socket hang up"
stack:"FetchError: request to https://storage.googleapis.com/tfjs-models/savedmodel/posenet/mobilenet/float/075/model-stride16.json failed, reason: socket hang up\n at ClientRequest.<anonymous> (c:\Workarea\Privat\golf-data-set-generator\node_modules\node-fetch\lib\index.js:1455:11)\n at ClientRequest.emit (events.js:200:13)\n at TLSSocket.socketOnEnd (_http_client.js:436:9)\n at TLSSocket.emit (events.js:205:15)\n at endReadableNT (_stream_readable.js:1154:12)\n at processTicksAndRejections (internal/process/task_queues.js:74:11)"
type:"system"
Code to reproduce the bug / link to feature request
This is the code I used:
const tf = require('@tensorflow/tfjs-node');
const posenet = require('@tensorflow-models/posenet');
try {
const net = await posenet.load();
// imageElement is canvas element from an image
pose = await net.estimateSinglePose(imageElement, {
flipHorizontal: false
});
} catch (error) {
console.log(error);
}
Well I had posenet.load() in a loop . Of course it would kill the download when I try to download the file 1000 times -.-
@nabbl I am using a loop as well because I am trying to identify objects in a video (so I had to cut it up into frames). I'm getting the same error. Is there a way I can run all the code and its dependencies on my computer so that I don't encounter this problem with Google blocking me?