Skip to content

Install script can't download the tensorflow lib from a HTTP host #6198

@danilosampaio

Description

@danilosampaio

System information

  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Ubuntu 20.04.4 LTS
  • TensorFlow.js installed from (npm or script link): @tensorflow/tfjs-node: ^3.13.0

Describe the problem
The Install script allows to set a environment variable to download the tensorflow lib from a custom host (TFJS_NODE_BASE_URI), but it's always using https.get:

const request = https.get(options, response => {

It could check the URI before to call https.get or http.get.

Provide the exact sequence of commands / steps that you executed before running into the problem

  • set the TFJS_NODE_BASE_URI variable to a custom HTTP host. Ex: http://mycustonhost/libtensorflow-
  • during installation, while it downloads the tensorflow lib, the following error accours:
18:09:19  > @tensorflow/tfjs-node@3.13.0 install /app/node_modules/@tensorflow/tfjs-node
18:09:19  > node scripts/install.js
18:09:19  
18:09:19  CPU-linux-3.13.0.tar.gz
18:09:19  �[91m* Downloading libtensorflow
18:09:19  �[0mhttp://mycustonhost/libtensorflow-cpu-linux-x86_64-2.7.0.tar.gz
18:09:19  �[91m(node:19) UnhandledPromiseRejectionWarning: TypeError [ERR_INVALID_PROTOCOL]: Protocol "http:" not supported. Expected "https:"
18:09:19      at new NodeError (internal/errors.js:322:7)
18:09:19      at new ClientRequest (_http_client.js:159:11)
18:09:19      at Object.request (https.js:370:10)
18:09:19      at Object.request (/app/node_modules/agent-base/patch-core.js:25:22)
18:09:19      at Object.https.get (/app/node_modules/agent-base/patch-core.js:48:21)
18:09:19      at Object.downloadAndUnpackResource (/app/node_modules/@tensorflow/tfjs-node/scripts/resources.js:53:25)
18:09:19      at downloadLibtensorflow (/app/node_modules/@tensorflow/tfjs-node/scripts/install.js:140:13)
18:09:19      at async run (/app/node_modules/@tensorflow/tfjs-node/scripts/install.js:208:5)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions