1 安装Torch

本文介绍Torch7的安装方法,因为本人安装Torch前安装了caffe,所以可能CUDA、cudnn、Blas等Torch可能需要用来的库的安装就不再重复介绍了,相关依赖出现问题的的猿友可以参考史上最全的caffe安装过程

1.1 安装luarock

lua是通过luarock来进行软件包管理的,Torch7的接口是lua,因此需要先安装Lua,本人安装的是lua52,安装过程主要参考Torch官方文档

1.2 参考官方文档遇到的问题

记录参考Torch官方文档安装Torch7出现一些问题。

qlua installation

luarocks install qtlua         //not qlua

(1) error: found unsuitable Qt version from NOTFOUND, this code requires Qt4.x

solution:

1.exclude anaconda env from your path.

Referrence

2.第二步:

sudo apt-get install qt-sdk

(2) error: module ‘qttorch’ not found: no field package.preload[‘qttorch’] it occur when I use qlua to run some sh

solutions:

luarocks install qttorch

(3) error: readline.h not found

after type ./install.sh , error readline.c:7:31: fatal error: readline/readline.h: No such file or directory #include <readline/readline.h>

solution:

sudo apt-get install libreadline-dev

reference

(4) error: luarocks install image , and occur getting connection timed out for couple of hours

solution:

git clone https://github.com/torch/image.git
cd image
luarocks make image-1.1.alpha-0.rockspec

reference

(5) error: module 'hdf5' not found:No LuaRocks module found for hdf5,

while run the generate heatmap model by type “ th run-hg.lua ../data/tennis jpg”

problem:

luarocks download package through git protocol, which will use ssh protocol. So we have to convert git download protocol to https protocol.

Solotion:

git config –global url.https://.insteadOf ssh://git
vim ~/.gitconfig

To certain .gitconfig like:

[url “https://”]
insteadOf = git://

(最好不要再添加别替换,否则会产生多重替换而我们看不出来。有时候我们在output_log里面看到依然git://github.com,但是这并不一定真实,git://被替换为https://有时候不会显式出来)

then type:

luarocks install hdf5
#it will print nothing, but running in background.
luarocks intsll hdf5 --verbose
#It will print all the imformation when downloading and compiling.

Reference

(6) warning: Failed loading manifest while type ”luarocks list”

Failed loading manifest for /home/werner/.luarocks/lib/luarocks/rocks: ~/.luarocks/lib/luarocks/rocks/manifest: No such file or directory

Solution:

mkdir -p ~/.luarocks/lib/luarocks/rocks
luarocks-admin make-manifest --local-tree --tree=$HOME/.luarocks

referrene

(7) error: getrf : Lapack library not found in compile time

solution:

git clone https://github.com/xianyi/OpenBLAS.git
cd OpenBLAS
make NO_AFFINITY=1 USE_OPENMP=1
sudo make install

then:

CMAKE_LIBRARY_PATH=/opt/OpenBLAS/include:/opt/OpenBLAS/lib:$CMAKE_LIBRARY_PATH
luarocks install torch

按照以上步骤就能解决问题,网上大多数人都能解决问题。但我们的机器依然报错。

Reference

后来我查看luarocks install torch输出发现:

OpenBlas detected

It seems OpenBlas has not been compiled with Lapack support

Then I try:

sudo apt-get install liblapack-dev

reinstall OpenBlas, then I found following information in top output:

OpenBLAS: Detecting fortran compiler failed. Cannot compile LAPACK. Only compile BLAS.

Google it found:

Reference

error OpenBLAS: Detecting fortran compiler failed. Please install fortran compiler, e.g. gfortran, ifort.

So,

sudo apt-get install gfortran

Then reinstall OpenBlas , it resolved.

[Torch]的安装的更多相关文章

  1. Torch的安装和学习

    Long long ago, 就已经安装好Torch,这里再记录一下.Torch是Facebook开发的用于AI的科学计算框架,可广泛运用于机器学习的很多算法.相比Caffe,其接口运用更加方便,使用 ...

  2. Torch 的安装与基本用法

    本文安装仅限 ubuntu 系统.官方文档见:Getting started with Torch. 0. 简介 Torch 使用轻量级脚本语言 Lua 及其 C/CUDA 扩展模块实现,底层数值计算 ...

  3. Windows版pytorch,torch简明安装

    好消息!!目前pytorch已经提供windows官方支持,可以直接安装了,请移步这里. pytorch是facebook开发的深度学习库,其目标是想成为深度学习领域整合gpu加速的numpy.笔者研 ...

  4. Torch,Tensorflow使用: Ubuntu14.04(x64)+ CUDA8.0 安装 Torch和Tensorflow

    系统配置: Ubuntu14.04(x64) CUDA8.0 cudnn-8.0-linux-x64-v5.1.tgz(Tensorflow依赖) Anaconda 1. Torch安装 Torch是 ...

  5. 安装torch

    一.实验环境 1.Windows7x64_SP1 2.anaconda3.7 + python3.7(anaconda集成,不需单独安装) 二.问题描述 1.使用如下命令进行安装: pip3 inst ...

  6. 安装pytorch后import torch显示no module named 'torch'

    问题描述:在pycharm终端里通过pip指令安装pytorch,显示成功安装但是python程序和终端都无法使用pytorch,显示no module named 'torch'. 起因:电脑里有多 ...

  7. centos安装torch==1.4.0与相关细节

    对于某些直接安装torch==1.4.0报错的情况(没错,就是我遇到了) 在网上查找了,大概的解决方法是先安装一个低版本的torch和torchvision, torchvision是pytorch中 ...

  8. 学习笔记CB012: LSTM 简单实现、完整实现、torch、小说训练word2vec lstm机器人

    真正掌握一种算法,最实际的方法,完全手写出来. LSTM(Long Short Tem Memory)特殊递归神经网络,神经元保存历史记忆,解决自然语言处理统计方法只能考虑最近n个词语而忽略更久前词语 ...

  9. python 下载.whl 文件,查看已安装软件包方法

    下载地址       https://www.lfd.uci.edu/~gohlke/pythonlibs/ 另一个Python packages地址为    https://pypi.org/ 下载 ...

随机推荐

  1. HOJ 13101 The Triangle Division of the Convex Polygon(数论求卡特兰数(模不为素数))

    The Triangle Division of the Convex Polygon 题意:求 n 凸多边形可以有多少种方法分解成不相交的三角形,最后值模 m. 思路:卡特兰数的例子,只是模 m 让 ...

  2. kubernetes node管理

    目录 Node的扩缩容 删除node节点 Node的隔离与恢复 通过配置文件实现 通过命令行的方式实现 恢复 更新资源对象的label 给一个node添加一个label 将pod调度到指定的node ...

  3. POJ - 2976 Dropping tests && 0/1 分数规划

    POJ - 2976 Dropping tests 你有 \(n\) 次考试成绩, 定义考试平均成绩为 \[\frac{\sum_{i = 1}^{n} a_{i}}{\sum_{i = 1}^{n} ...

  4. 《Java程序猿面试宝典》之字符串

    前不久刚看完这一章,然而这遗忘速度实在是不能忍,既然总是遗忘,那么老衲就和你磨上一磨. 1.字符串基础 先说字符串吧,看例1: String a = "abc"; String b ...

  5. 前端如何使用easy-mock模拟接口

    1. 如何使用easy-mock // 获取 easy-mock 的模拟数据 getData () { // 开发环境使用 easy-mock 数据,正式环境使用 json 文件 if (proces ...

  6. Dubbo学习笔记2:Dubbo服务提供端与消费端应用的搭建

    Demo结构介绍 Demo使用Maven聚合功能,里面有三个模块,目录如下: 其中Consumer模块为服务消费者,里面TestConsumer和consumer.xml组成了基于Spring配置方式 ...

  7. SpringCloud (十) Hystrix Dashboard单体监控、集群监控、与消息代理结合

    一.前言 Dashboard又称为仪表盘,是用来监控项目的执行情况的,本文旨在Dashboard的使用 分别为单体监控.集群监控.与消息代理结合. 代码请戳我的github 二.快速入门 新建一个Sp ...

  8. Docker 初相见

    Docker 是一个开源的应用容器引擎,基于 Go 语言 并遵从Apache2.0协议开源. Docker 可以让开发者打包他们的应用以及依赖包到一个轻量级.可移植的容器中,然后发布到任何流行的 Li ...

  9. Shader 学习工具篇 可视化公式工具ZGrapher

    大家好,我是怒风,本篇介绍公式可视化公式工具ZGrapher,尝试通过可视化的方式分析一下Shader中应用的公式,以求帮助初学者快速理解Shader编程中的一些常用公式 本篇的目的两个, 第一,介绍 ...

  10. 20155210潘滢昊 2016-2017-2 《Java程序设计》第5周学习总结

    20155210 2016-2017-2 <Java程序设计>第5周学习总结 教材学习内容总结 try with resources 关闭多个资源时用分号分隔 java.lang.Auto ...