我为对象检测制作了一个 tfjs 解决方案,并希望将其部署在公司代理后面的服务器上。
发生问题是因为tensorflow\tfjs-node\scripts\install.js
不支持代理,因此它尝试https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-windows-x86_64-1.15.0.zip
直接从服务器获取,这是不可能的。
我已经设置了我的 npm 配置
$npm config list
和 console.log 是:
; cli configs
metrics-registry = "http://registry.npmjs.org/"
scope = ""
user-agent = "npm/6.14.4 node/v12.18.0 win32 x64"
; userconfig C:\Users\user\.npmrc
https-proxy = "http://182.192.254.44:8080/"
proxy = "http://182.192.254.44:8080/"
python = "="
registry = "http://registry.npmjs.org/"
strict-ssl = false
; builtin config undefined
prefix = "C:\\Users\\user\\AppData\\Roaming\\npm"
; node bin location = C:\Program Files\nodejs\node.exe
; cwd = C:\IPA\beauty\TrackingServerProject
; HOME = C:\Users\usename
; "npm config ls -l" to show all defaults.
如您所见,由于代理,我得到了下一个错误。
$ npm install @tensorflow/tfjs-node
> @tensorflow/tfjs-node@2.0.1 install C:\IPA\beauty\TrackingServerProject\node_modules\@te
> node scripts/install.js
CPU-windows-2.0.1.zip
* Downloading libtensorflow
events.js:292
throw er; // Unhandled 'error' event
^
Error: connect ETIMEDOUT 64.233.189.128:443
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1141:16)
Emitted 'error' event on ClientRequest instance at:
at TLSSocket.socketErrorListener (_http_client.js:426:9)
at TLSSocket.emit (events.js:315:20)
at emitErrorNT (internal/streams/destroy.js:92:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:60:3)
at processTicksAndRejections (internal/process/task_queues.js:84:21) {
errno: 'ETIMEDOUT',
code: 'ETIMEDOUT',
syscall: 'connect',
npm ERR! @tensorflow/tfjs-node@2.0.1 install: `node scripts/install.js`
我认为我可能需要更改tensorflow\tfjs-node\scripts\install.js
以添加代理?
请帮忙!