digits安装和相关bug解决办法
digits安装
一.从github上克隆并下载DIGITS项目
git clone https://github.com/NVIDIA/DIGITS.git digits
二…编译和安装对应依赖
cd digits
sudo apt-get install graphviz gunicorn
for req in $(cat requirements.txt); do sudo pip2 install --usr $req;done #适用于python2
pip install -r ~/digits/requirements.txt #进行更新
三.修改load_from_envvar函数
1.打开路径
~/digits/digits/config/caffe.py 1
2.在 load_from_envvar函数中修改代码
if platform.system() == 'Windows':
executable_dir = os.path.join(value, 'install', 'bin')
python_dir = os.path.join(value, 'install', 'python')
else:
#executable_dir = os.path.join(value, 'build', 'tools')
executable_dir = '/home/cow/caffe/build/tools' #对应用户目录进行修改
#python_dir = os.path.join(value, 'python')
python_dir = '/home/cow/caffe/python' #对应用户目录进行修改
否则,会出现A valid Caffe installation was not found on your system的错误提示
3.digits调用出现 `SyntaxError: Non-ASCII character ‘\xe5’ in file digits/config/caffe.py on line 27, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
修改caffe.py文件出现了中文,在程序开头加上
-- coding:UTF-8 --
即可
4.digits调用出现:ValueError: Caffe executable not found in PATH
1).检查当前envvar的值
echo $CAFFE_ROOT
2).把envvar加到~/.profile中,下次当你登录时会自动加载
echo "export CAFFE_ROOT=/home/username(我的账户名)/caffe/" >> ~/.profile
3).加载新配置
source ~/.profile
4).检查新配置
echo $CAFFE_ROOT
/home/username/caffe/
按上面的方法改了之后,digits顺利启动
四、运行digits
1.进入digits目录下运行服务
/digits-devserver
2.打开浏览器,输入localhost:5000
3.所处局域网机子输入http://ip地址:5000