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 revision
wget http://download.zeromq.org/zeromq-4.0.5.tar.gz
tar xzvf zeromq-4.0.5.tar.gz
cd zeromq-4.0.5
./configure
make
sudo make install
cd ..
sudo apt-get install python-dev -y
sudo apt-get install python-pip -y
sudo pip install ipython
sudo apt-get install python-zmq -y
sudo apt-get install python-markupsafe -y
sudo apt-get install python-jsonschema -y
sudo pip install jinja2
sudo pip install tornado
sudo luarocks install luacrypto
sudo luarocks install env
sudo luarocks install lzmq
sudo luarocks install lbase64
sudo luarocks install uuid
# add some decoders for iTorch audio and video
sudo apt-get install gstreamer1.0-libav -y
# Install iTorch
git clone https://github.com/facebook/iTorch.git
cd iTorch
sudo env "PATH=$PATH" luarocks make
sudo 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 命令进入浏览器界面,输入相应脚本后图片正常显示。