tensorspace-converter icon indicating copy to clipboard operation
tensorspace-converter copied to clipboard

Error: browserHTTPRequest is not supported outside the web browser without a fetch polyfill.

Open looduy opened this issue 5 years ago • 0 comments

TensorFlow.js version tensorflow/tfjs: 1.0.0 tensorflow/tfjs-node: 1.2.11

tensorspacejs 0.2.0

Node version node 11.11.0 on Centos7

I have used TensorSpace-Converter to preprocess pre-trained TensorFlow.js model:

Tensorspacejs_converter  \
   --input_model_from="tfjs" \
    --output_layer_names="myPadding,myConv1,myMaxPooling1,myConv2,myMaxPooling2,myDense1,myDense2,myDense3" \
    /root/mnist.json \
    /root/test/

Following error was displayed:

2019-10-23 11:16:14.243013: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
2019-10-23 11:16:14.451468: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 3600000000 Hz
2019-10-23 11:16:14.451808: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x4821350 executing computations on platform Host. Devices:
2019-10-23 11:16:14.451837: I tensorflow/compiler/xla/service/service.cc:175]   StreamExecutor device (0): <undefined>, <undefined>
Loading tfjs model...
(node:76897) UnhandledPromiseRejectionWarning: Error: browserHTTPRequest is not supported outside the web browser without a fetch polyfill.
    at new BrowserHTTPRequest (/root/anaconda2/envs/envname/lib/python3.6/site-packages/tensorspacejs/tfjs/node_modules/@tensorflow/tfjs-core/dist/io/browser_http.js:76:23)
    at Object.browserHTTPRequest (/root/anaconda2/envs/envname/lib/python3.6/site-packages/tensorspacejs/tfjs/node_modules/@tensorflow/tfjs-core/dist/io/browser_http.js:456:12)
    at Object.<anonymous> (/root/anaconda2/envs/envname/lib/python3.6/site-packages/tensorspacejs/tfjs/node_modules/@tensorflow/tfjs-layers/dist/models.js:245:50)
    at step (/root/anaconda2/envs/envname/lib/python3.6/site-packages/tensorspacejs/tfjs/node_modules/@tensorflow/tfjs-layers/dist/models.js:54:23)
    at Object.next (/root/anaconda2/envs/envname/lib/python3.6/site-packages/tensorspacejs/tfjs/node_modules/@tensorflow/tfjs-layers/dist/models.js:35:53)
    at /root/anaconda2/envs/envname/lib/python3.6/site-packages/tensorspacejs/tfjs/node_modules/@tensorflow/tfjs-layers/dist/models.js:29:71
    at new Promise (<anonymous>)
    at __awaiter (/root/anaconda2/envs/envname/lib/python3.6/site-packages/tensorspacejs/tfjs/node_modules/@tensorflow/tfjs-layers/dist/models.js:25:12)
    at Object.loadLayersModelInternal (/root/anaconda2/envs/envname/lib/python3.6/site-packages/tensorspacejs/tfjs/node_modules/@tensorflow/tfjs-layers/dist/models.js:232:12)
    at Object.loadLayersModel (/root/anaconda2/envs/envname/lib/python3.6/site-packages/tensorspacejs/tfjs/node_modules/@tensorflow/tfjs-layers/dist/exports.js:224:21)
(node:76897) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:76897) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Mission Complete!!!

How can I solve this error?

looduy avatar Oct 23 '19 04:10 looduy