NVIDIA DIGITS 5.1-dev学习笔记之安装过程记录:Windows10 x64位系统 、 MicroSoft Caffe Master、CUDA 8.0 、Python 2.7
今天成功在windows下配置成功了英偉達的DIGITS,記錄一下問題解決過程。?
環境簡介: Windows10_x64 CUDA 8.0 / CUDA 7.5 Python2.7 Microsoft-Caffe-master?
Github DIGITS:?https://github.com/NVIDIA/DIGITS/blob/master/docs/BuildDigitsWindows.md?點擊打開鏈接?
完全按照此步驟操作不會出現問題,尤其是 關于Python?package的版本問題,詳見DIGITS-master目錄下的requirements.txt:
Pillow>=2.3.0,<=3.1.2?
numpy>=1.8.1,<=1.11.0?
scipy>=0.13.3,<=0.17.0?
protobuf>=2.5.0,<=2.6.1?
six>=1.5.2,<=1.10.0?
requests>=2.2.1,<=2.9.1?
gevent>=1.0,<=1.1.0?
gevent-websocket==0.9.3?
Flask==0.10.1?
Flask-WTF>=0.11,<=0.12?
wtforms>=2.0,<=2.1?
Flask-SocketIO==2.6?
setuptools>=3.3,<=20.7.0?
lmdb==0.87?
h5py>=2.2.1,<=2.6.0?
pydot>=1.0.28,<=1.0.29?
psutil>=1.2.1,<=3.4.2?
matplotlib>=1.3.1,<=1.5.1?
scikit-fmm>=0.0.9
版本號一定確保和上述一致。
**
BUG 1 : 與google.protobuf 有關
**?
我記得是在加載from google.protobuf import _symbol 指令時(大概就是這個指令吧),問題是由于我原來安裝的時ptotobuf 2.5.0,版本有點低,然后我更新到2.6.1后,就沒問題了。ptotobuf在windows下的python支持編譯方法請自行google。
BUG 2 : 當我運行時
I:\DIGITS-master>python -m digits___ ___ ___ ___ _____ ___| \_ _/ __|_ _|_ _/ __|| |) | | (_ || | | | \__ \|___/___\___|___| |_| |___/ 5.1-devA valid Caffe installation was not found on your system. Use the envvar CAFFE_ROOT to indicate a valid installation. Traceback (most recent call last):File "I:\Python27\lib\runpy.py", line 174, in _run_module_as_main"__main__", fname, loader, pkg_name)File "I:\Python27\lib\runpy.py", line 72, in _run_codeexec code in run_globalsFile "I:\DIGITS-master\digits\__main__.py", line 70, in <module>main()File "I:\DIGITS-master\digits\__main__.py", line 53, in mainimport digits.configFile "digits\config\__init__.py", line 7, in <module>from . import ( # noqaFile "digits\config\caffe.py", line 230, in <module>executable, version, flavor = load_from_path()File "digits\config\caffe.py", line 58, in load_from_pathversion, flavor = get_version_and_flavor(executable)File "digits\config\caffe.py", line 157, in get_version_and_flavorversion = parse_version(version_string)File "digits\utils\__init__.py", line 160, in parse_versionreturn pkg_resources.SetuptoolsVersion(v)File "I:\Python27\lib\site-packages\pkg_resources\_vendor\packaging\version.py", line 202, in __init__raise InvalidVersion("Invalid version: '{0}'".format(version)) pkg_resources._vendor.packaging.version.InvalidVersion: Invalid version: 'CAFFE_VERSION'- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
然后,我看了下caffe.py這個文件。?
caffe.py:?
關鍵信息我都紅色標記了。
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
- 76
- 77
- 78
- 79
- 80
- 81
- 82
- 83
- 84
- 85
- 86
- 87
- 88
- 89
- 90
- 91
- 92
- 93
- 94
- 95
- 96
- 97
- 98
- 99
- 100
- 101
- 102
- 103
- 104
- 105
- 106
- 107
- 108
- 109
- 110
- 111
- 112
- 113
- 114
- 115
- 116
- 117
- 118
- 119
- 120
- 121
- 122
- 123
- 124
- 125
- 126
- 127
- 128
- 129
- 130
- 131
- 132
- 133
- 134
- 135
- 136
- 137
- 138
- 139
- 140
- 141
- 142
- 143
- 144
- 145
- 146
- 147
- 148
- 149
- 150
- 151
- 152
- 153
- 154
- 155
- 156
- 157
- 158
- 159
- 160
- 161
- 162
- 163
- 164
- 165
- 166
- 167
- 168
- 169
- 170
- 171
- 172
- 173
- 174
- 175
- 176
- 177
- 178
- 179
- 180
- 181
- 182
- 183
- 184
- 185
- 186
- 187
- 188
- 189
- 190
- 191
- 192
- 193
- 194
- 195
- 196
- 197
- 198
- 199
- 200
- 201
- 202
- 203
- 204
- 205
- 206
- 207
- 208
- 209
- 210
- 211
- 212
- 213
- 214
- 215
- 216
- 217
- 218
- 219
- 220
- 221
- 222
- 223
- 224
- 225
- 226
- 227
- 228
- 229
- 230
- 231
- 232
- 233
- 234
- 235
- 236
- 237
- 238
- 239
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
- 76
- 77
- 78
- 79
- 80
- 81
- 82
- 83
- 84
- 85
- 86
- 87
- 88
- 89
- 90
- 91
- 92
- 93
- 94
- 95
- 96
- 97
- 98
- 99
- 100
- 101
- 102
- 103
- 104
- 105
- 106
- 107
- 108
- 109
- 110
- 111
- 112
- 113
- 114
- 115
- 116
- 117
- 118
- 119
- 120
- 121
- 122
- 123
- 124
- 125
- 126
- 127
- 128
- 129
- 130
- 131
- 132
- 133
- 134
- 135
- 136
- 137
- 138
- 139
- 140
- 141
- 142
- 143
- 144
- 145
- 146
- 147
- 148
- 149
- 150
- 151
- 152
- 153
- 154
- 155
- 156
- 157
- 158
- 159
- 160
- 161
- 162
- 163
- 164
- 165
- 166
- 167
- 168
- 169
- 170
- 171
- 172
- 173
- 174
- 175
- 176
- 177
- 178
- 179
- 180
- 181
- 182
- 183
- 184
- 185
- 186
- 187
- 188
- 189
- 190
- 191
- 192
- 193
- 194
- 195
- 196
- 197
- 198
- 199
- 200
- 201
- 202
- 203
- 204
- 205
- 206
- 207
- 208
- 209
- 210
- 211
- 212
- 213
- 214
- 215
- 216
- 217
- 218
- 219
- 220
- 221
- 222
- 223
- 224
- 225
- 226
- 227
- 228
- 229
- 230
- 231
- 232
- 233
- 234
- 235
- 236
- 237
- 238
- 239
然后就跑起來吧!!!
貼圖看效果:?
1. 訓練ing
?
2.?測試,可以看特征圖,參數啊啊啊(Nvidia DIGITS大法好)
下面是安裝步驟!!!
Build DIGITS on Windows
Limitation
DIGITS for Windows depends on Windows branch of BVLC Caffe. The following layers, required for DetectNet feature, are not implemented in that branch.
detectnet_transform_layer?
l1_loss_layer?
As a result, DIGITS for Windows does not support DetectNet. To run DIGITS with DetectNet, please use NV-Caffe 0.15 or above on Ubuntu.
Prerequisites
Python2?
CUDA 7.5?
CuDNN 5.1?
Caffe?
Graphviz
Installing prerequisites
Python2
Download and install Python 2.7.11 64bit from Python’s official site (https://www.python.org/ftp/python/2.7.11/python-2.7.11.amd64.msi). Please select Add Python Path during installation.
Download numpy, scipy, matplotlib, scikit-image, h5py from Unofficial Windows Binaries for Python Extension Packages webpage at (http://www.lfd.uci.edu/~gohlke/pythonlibs/). Remember to download correct version (2.7) and architecture (64-bit).
Additionally, download gevent v1.0.2 at the same site. Run command prompt (cmd.exe) as administrator, and issue the following commands.
python -m pip install cython?
python -m pip install numpy-1.11.0+mkl-cp27-cp27m-win_amd64.whl?
python -m pip install scipy-0.17.0-cp27-none-win_amd64.whl?
python -m pip install matplotlib-1.5.1-cp27-none-win_amd64.whl?
python -m pip install scikit_image-0.12.3-cp27-cp27m-win_amd64.whl?
python -m pip install h5py-2.6.0-cp27-cp27m-win_amd64.whl
If the installation process complains compiler not found, you need to install Microsoft Visual C++ Compiler for Python 2.7, downloaded at (https://www.microsoft.com/en-us/download/details.aspx?id=44266). We recommend installing it by
msiexec /i VCForPython27.msi ALLUSERS=1?
After that compiler is installed, finish the above python -m pip install commands.
At this moment, do not install gevent yet. We need to install it after installing DIGITS.
CUDA 7.5
CUDA 7.5 can be obtained at NVIDIA CUDA (https://developer.nvidia.com/cuda-downloads). Please select Windows 7 to download.
CuDNN 5.1
Download CuDNN 5.1 at NVIDIA website (https://developer.nvidia.com/cudnn). Please select CuDNN 5.1 for CUDA 7.5.
Caffe
Caffe can be obtained at (https://github.com/bvlc/caffe/tree/windows). Note you need to install Visual Studio 2013 to build Caffe. Before building it, enable Python support, CUDA and CuDNN by following instructions on the same page. Because we are using Official CPython, please change the value of PythonDir tag from C:\Miniconda2\ to C:\PYTHON27\ (assume your CPython installation is the default C:\PYTHON27). After building it, configure your Python environment to include pycaffe, which is described at (https://github.com/bvlc/caffe/tree/windows#remark). Your caffe.exe will be inside Build\x64\Release directory (if you made release build).
Graphviz
Graphviz is available at (www.graphviz.org/Download.PHP). Please note this site is not always available online. The installation directory can not contain space, so don’t install it under the regular ‘c:\Program Files (x86)’ directory. Try something like ‘c:\graphviz’ instead. When the installation directory contains space, pydot could not launch the dot.exe file, even it has no problem finding it. Add the c:\graphviz\bin directory to your PATH.
Installing DIGITS
Clone DIGITS from github.com (https://github.com/nvidia/digits). From the command prompt (run as administrator) and cd to DIGITS directory. Then type
python -m pip install -r requirements.txt
You may see error about Pillow, like ValueError: jpeg is required unless explicitly disabled using –disable-jpeg, aborting If this happens, download Pillow Windows Installer (Pillow-3.1.1.win-amd64-py2.7.exe) at?https://pypi.python.org/pypi/Pillow/3.1.1?and run the exectuables. After installing Pillow in the above way, run
python -m pip install -r requirements.txt
again.
After the above command, check if all required Python dependencies are met by comparing requirements.txt and output of the following command.
python -m pip list
If gevent is not v1.0.2, install it from the whl file, downloaded previously from (http://www.lfd.uci.edu/~gohlke/pythonlibs/).
python -m pip install gevent-1.0.2-cp27-none-win_amd64.whl
It should uninstall the gevent you had, and install gevent 1.0.2.
Because readline is not available in Windows, you need to install one additional Python package.
python -m pip install pyreadline
Running DIGITS
First, check if caffe executable is included in your PATH environment variable. If not, add it.
set PATH=%PATH%;MY_CAFFE_ROOT\Build\x64\Release
Replace MY_CAFFE_ROOT with your local caffe directory.
Launch DIGITS devserver with the following command:
python digits-devserver
Point your browser to localhost:5000. You should be able to see DIGITS.
Troubleshooting
DIGITS crashes when trying to classify images with?* Show visualizations and statistics *
This issue should have been resolved. However, if you still encounter this issue, this seems related to different hdf5 DLL binding between pycaffe and h5py. The DLL used by pycaffe was pulled from nuget, and its version is 1.8.15.2. Slightly older than the DLL in h5py. A temporary solution is to load h5py before pycaffe. To force loading h5py before pycaffe, you can either add one line at the beginning of digits-devserver file, or import h5py just before import caffe in digits/config/caffe_option.py.
import readline causes ImportError
Change import readline in digits\config\prompt.py to
try:import readline except ImportError:import pyreadline as readline- 1
- 2
- 3
- 4
- 1
- 2
- 3
- 4
DIGITS complains Torch binary not found in PATH
Currently, DIGITS does not support Torch on Windows platform.
總結
以上是生活随笔為你收集整理的NVIDIA DIGITS 5.1-dev学习笔记之安装过程记录:Windows10 x64位系统 、 MicroSoft Caffe Master、CUDA 8.0 、Python 2.7的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: windows平台下caffe可视化配置
- 下一篇: 安装Windows digits问题列表