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