ubuntu16安装Torch
2017-12-18 16:08
218 查看
1.下载LuaJIT(C语言编写的Lua的解释器)和Torch所必需的依赖包
2.安装依赖包和Torch (执行时间可能有点长)
3.bashrc文件配置
4.验证Torch
5.安装其他依赖库
6.下载neural style代码和VVG模型测试CPU/GPU
6.安装cuda
7.安装cudnn
8.torch测试cuda+cudnn
$mkdir -p ~/torch //在创建需要安装的目录位置 $cd ~/torch $git clone https://github.com/torch/distro.git . --recursive
2.安装依赖包和Torch (执行时间可能有点长)
$./install-deps //安装依赖包 $./install.sh //安装Torch
3.bashrc文件配置
终端提示: Do you want to automatically prepend the Torch install locationto PATH and LD_LIBRARY_PATH in your /home/xxxx/.bashrc? (yes/no) $yes
4.验证Torch
//重启终端,然后输入如下命令: $th //如果没有报错提示,表示安装成功
5.安装其他依赖库
//如果protobuf已经安装了,可以不用再安装 $sudo apt-get install libprotobuf-dev protobuf-compiler $luarocks install loadcaffe
6.下载neural style代码和VVG模型测试CPU/GPU
$cd ~/ $git clone https://github.com/jcjohnson/neural-style.git $cd neural-style //下载VGG模型 $sh models/download_models.sh //CPU版本的测试 $th neural_style.lua -gpu -1 -print_iter 1 //GPU版本的测试 $th neural_style.lua -gpu 0 -print_iter 1
6.安装cuda
$luarocks install cutorch $luarocks install cunn //测试一下 $th -e "require 'cutorch'; require 'cunn'; print(cutorch)"
7.安装cudnn
tar -xzvf cudnn-8.0-linux-x64-v5.1.tgz $sudo cp cuda/lib64/libcudnn* /usr/local/cuda/lib64/ $sudo cp cuda/include/cudnn.h /usr/local/cuda/include/ $luarocks install cudnn //测试一下: $th neural_style.lua -gpu 0 -backend cudnn //如果提示cudnn5.1找不到,则到Nvidia官网重新下载cudnn5.1替换本地现有的其它版本的cudnn,然后重新安装$cudnn:luarocks install cunn和测试cudnn //我本地原来的cudnn版本是v7,没办法,该torch版本只支持cudnnv5.1
8.torch测试cuda+cudnn
$cd ~/torch $./test.sh
相关文章推荐
- Ubuntu16安装opencv
- Ubuntu16安装删除libfreenect2
- ubuntu16+virtualbox 安装 hadoop(共享目录, tar, 改主机名hostname)杂记
- Ubuntu16安装Chrome浏览器
- DL学习笔记【21】ubuntu16 使用经验汇总 + torch7 + iTorch
- 安装Ubuntu 16.04时出现:没有定义根文件系统,请到分区菜单修改
- 在ubuntu16 版本下安装谷歌启动google_chrome报错
- Ubuntu16 安装arm-linux-gcc
- Ubuntu16 64位安装android studio的32位库 sudo apt-get install lib32bz2-1.0失败
- opencv-3.4在ubuntu16安装
- 在VMware中安装Ubuntu 16
- 嵌入式Linux基础知识4(ubuntu16安装)
- Ubuntu16安装nginx
- ubuntu16 安装ros运行小海龟
- ubuntu 16 安装sublime
- ubuntu16 kubernetes1.6安装(六、node节点部署)
- CDH的完全离线安装(ubuntu16)
- ubuntu16-04安装GPU版本的caffe
- windows 10安装ubuntu 16,双系统安装教程
- ubuntu 14.04 安装torch及编译环境zbstudio