ubuntu16.04安装torch

来源:互联网 发布:单片机数据类型 编辑:程序博客网 时间:2024/04/28 02:09

下载torch安装包:

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

安装依赖库:

 cd torch/ sudo bash install-deps

安装好后会提示:

Torch7’s dependencies have been installed

安装torch:

sudo ./install.sh

安装到最后会提示是否将torch安装路径加入~/.bashrc文件中:

Do you want to automatically prepend the Torch install location
to PATH and LD_LIBRARY_PATH in your /home/qinghua/.bashrc? (yes/no)

选择自动添加,输入yes,按enter键即可.

这里写图片描述

终端输入th命令进入torch:

th

这时提示错误:

/usr/local/bin/th: 行 3: /home/qinghua/program/torch_src/torch/install/bin/luajit: 没有那个文件或目录

这是因为系统找不到torch安装路径,这时候需要更新环境变量,即运行:

source ~/.bashrc

重新输入th即可.

th

这里写图片描述

原创粉丝点击