如何在ubuntu中安装pytorch
发布网友
发布时间:2022-04-20 16:20
我来回答
共1个回答
热心网友
时间:2022-04-11 03:26
你好,
方法:
Torch是一个广泛支持机器学习算法的科学计算框架,由于采用简单而快速的脚本语言LuaJIT和一个底层的C/CUDA实现,Torch易于使用且高效。
Torch安装
首先,值得注意的是,最新版的Torch支持Ubuntu,Fedora20,Fedora22,Centos7。但不支持Fedora21,Centos6。
参考官网安装流程安装,如下所示,
# in a terminal, run the commands
git clone /torch/distro.git ~/torch --recursive
cd ~/torch; bash install-deps;
./install.sh12341234
在执行bash install-deps安装依赖时并未出错,但执行./install.sh时会出一些错误,见下面。
Torch安装问题汇总
错误1
错误类似于:
nvcc error : '***' died e to signal 2
解决方案:sudo ./install.sh
错误2
Error: Build error: Failed building.
Updating manifest for /root/torch/install/lib/luarocks/rocks
fftw3 scm-1 is now built and installed in /root/torch/install/ (license: BSD)123123
错误3
Error: Failed installing dependency: rocks-moonscript-org/moonrocks-mirror/master/luacrypto-0.3.2-1.src.rock - Could not find header file for OPENSSL
No file openssl/evp.h in /usr/local/include
No file openssl/evp.h in /usr/include
You may have to install OPENSSL in your system and/or pass OPENSSL_DIR or OPENSSL_INCDIR to the luarocks command.
Example: luarocks install luacrypto OPENSSL_DIR=/usr/local1234512345
参照Problem with Torch #86,执行sudo apt-get install -y libssl-dev安装libssl-dev,之后重新安装Torch即可。
错误4
提示缺少依赖lbase64 ,luacrypto,uuid 等,可直接执行luarocks install missed-package解决。