itorch安装

来源:互联网 发布:mac搜狗输入法怎么用 编辑:程序博客网 时间:2024/06/18 00:04

itorch安装

安装完torch后,命令行输入th命令后进入命令行界面。但在进行训练时需要用到itorch,所以搜集到下面的资料并成功安装了itorch。

https://gist.github.com/jetsonhacks/ad01566922a5c2648a10

Install iTorch and prerequisites

#!/bin/sh# Install Python prerequisites on NVIDIA Jetson TK1 for iTorch# This is for https://github.com/facebook/iTorch# L4T 21.3, Torch 7 (http://torch.ch)# Python 2.7 or greater must be installed before running this script# Torch 7 should already be installed before running this script# iPython is loaded using pip, as repository version is 1.x version, > 2.0 is needed# Need to compile from source as repository version libzmq3-dev is not the correct revisionwget http://download.zeromq.org/zeromq-4.0.5.tar.gztar xzvf zeromq-4.0.5.tar.gzcd zeromq-4.0.5./configuremakesudo make installcd ..sudo apt-get install python-dev -ysudo apt-get install python-pip -ysudo pip install ipythonsudo apt-get install python-zmq -ysudo apt-get install python-markupsafe -ysudo apt-get install python-jsonschema -ysudo pip install jinja2sudo pip install tornadosudo luarocks install luacrypto sudo luarocks install envsudo luarocks install lzmqsudo luarocks install lbase64sudo luarocks install uuid# add some decoders for iTorch audio and videosudo apt-get install gstreamer1.0-libav -y# Install iTorchgit clone https://github.com/facebook/iTorch.gitcd iTorchsudo env "PATH=$PATH" luarocks makesudo chown -R $USER $(dirname $(ipython locate profile))

上面的命令执行成功后运行

luarocks make

执行成功后,命令行输入itorch,即可弹出itorch命令界面。

但在执行上面脚本的过程中遇到了很多问题,下面罗列安装时遇到的问题和解决方法。

1 ,在使用pip命令时出现错误,发现是python和pip版本不一致导致,根据链接中的步骤,pip install命令正常
http://tenderrain.blog.51cto.com/9202912/1597900

2,ImportError: No module named enum

https://github.com/numba/llvmlite/issues/16
pip install enum34.

3,ImportError: cannot import name walk

http://stackoverflow.com/questions/39864607/importerror-on-scandir

pip install scandir

4, ImportError: No module named shutil_get_terminal_size

https://github.com/ipython/ipython/issues/9815

pip install backports.shutil_get_terminal_size

5,ImportError: No module named pygments.lexers

http://stackoverflow.com/questions/26215738/how-to-install-pygments-on-ubuntu

sudo apt-get install python-pygments
pip install package-name-here

6,ImportError: No module named decorator ?

https://www.odoo.com/zh_CN/forum/help-1/question/importerror-no-module-named-decorator-63458

sudo apt-get install python-decorator

7,ImportError: No module named notebook.notebookapp

http://www.cnblogs.com/ningmo/p/5921770.html

pip install jupyter

其他链接:

http://www.cnblogs.com/zhaojiedi1992/p/zhaojiedi_python_001.html

https://github.com/karpathy/char-rnn/issues/86

深度学习开源框架链接:http://deeplearning.net/software_links/

8,运行命令显示图片时弹出错误,提示找不到libpng。

需要将image包重新安装一下
luarocks install image

备注:安装成功后后,在ubuntu的terminal中输出图像,命令行显示并不支持在当前命令行输出,改用itorch notebook 命令进入浏览器界面,输入相应脚本后图片正常显示。

0 0
原创粉丝点击