torch7 安装 并安装 hdf5模块 torch模块 nn模块 (系统平台为 ubuntu18.04 版本)

今年的CCF A会又要开始投稿了,实验室的师弟还在玩命的加实验,虽然我属于特殊情况是该从靠边站被老板扶正但是实验室的事情我也尽力的去帮助大家,所以师弟在做实验的时候遇到了问题也会来问问我,这次遇到的一个问题就是torch7的安装,以及 hdf5模块,torch模块 , nn模块的安装 搞不上,于是乎我就再次出马了,于是就有了这次的博客。

首先,要说下这次的安装平台为  Linux 的  Ubuntu18.04 。

torch7的安装

torch7 的官网

http://torch.ch/docs/getting-started.html

第一步,下载源码

sudo git clone https://github.com/torch/distro.git /opt/torch --recursive

第二步, 编译

cd torch/
sudo bash install-deps

第三步, 安装

sudo ./install.sh

但是,这时候报错了,    THC_generated_THCTensorMathPairwise.cu.o

这步的解决参考文章:

安装torch出现如下错误make[2]: *** [lib/THC/CMakeFiles/THC.dir/THC_generated_THCTensorMath.cu.o] Error 1 CMak

https://blog.csdn.net/jainszhang/article/details/82777762

于是乎,我们这么操作:

sudo su

export TORCH_NVCC_FLAGS="-D__CUDA_NO_HALF_OPERATORS__"

稍等片刻

最终, 安装成果

以上是    torch7   的安装方法,   下面我们介绍具体模块的安装。

====================================================================

猜你喜欢

转载自www.cnblogs.com/devilmaycry812839668/p/10223706.html