美文网首页
开篇 - 环境安装(@tensorflow/tfjs-node)

开篇 - 环境安装(@tensorflow/tfjs-node)

作者: 旧时袋 | 来源:发表于2021-01-15 21:38 被阅读0次

安装这个花了老长时间了,网上的办法都测过了,不行, 还是自己研究!下面就是主要安装步骤
(不详细的话,会补充)

安装前提环境

因为要安装 @tensorflow/tfjs-node 前需要一些C++库和python版本的支持
可以在 https://github.com/nodejs/node-gyp 网站中找到安装方法(用如下命令就可一键安装啦!)

image.png
npm install --global windows-build-tools

注:cmd 要用管理员打开才能安装(当然前提 你得安装了 npm)


image.png

现在你就可以安装 @tensorflow/tfjs-node

官网 https://github.com/tensorflow/tfjs/tree/master/tfjs-node

image.png

如果按 官网的来会报一些 奇奇怪怪的错误

events.js:174       
             throw er; // Unhandled 'error' event       
^  Error: read ECONNRESET     
at TLSWrap.onStreamRead (internal/stream_base_commons.js:111:27) 
Emitted 'error' event at:     
at TLSSocket.socketErrorListener (_http_client.js:392:9)

找了好久还是不行,无意间,使用 cnpm 安装竟然成功啦!

安装命令如下,前提你得安装了 cnpm (安装方法自行百度)

cnpm install @tensorflow/tfjs-node

相关文章

网友评论

      本文标题:开篇 - 环境安装(@tensorflow/tfjs-node)

      本文链接:https://www.haomeiwen.com/subject/miuyoktx.html