日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > windows >内容正文

windows

NVIDIA DIGITS 5.1-dev学习笔记之安装过程记录:Windows10 x64位系统 、 MicroSoft Caffe Master、CUDA 8.0 、Python 2.7

發布時間:2024/9/21 windows 32 豆豆
生活随笔 收集整理的這篇文章主要介紹了 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:?
關鍵信息我都紅色標記了。

from __future__ import absolute_importimport imp import os import platform import re import subprocess import sysfrom . import option_list from digits import device_query from digits.utils import parse_versiondef load_from_envvar(envvar):"""Load information from an installation indicated by an environment variable"""value = os.environ[envvar].strip().strip("\"' ") #此處需要修改路徑,于CAFFE_HOME對應if platform.system() == 'Windows':#executable_dir = os.path.join(value, 'install', 'bin')executable_dir = os.path.join(value)#python_dir = os.path.join(value, 'install', 'python')python_dir = os.path.join(value, 'pycaffe')else:executable_dir = os.path.join(value, 'build', 'tools')python_dir = os.path.join(value, 'python')try:executable = find_executable_in_dir(executable_dir)if executable is None:raise ValueError('Caffe executable not found at "%s"'% executable_dir)if not is_pycaffe_in_dir(python_dir):raise ValueError('Pycaffe not found in "%s"'% python_dir)import_pycaffe(python_dir)version, flavor = get_version_and_flavor(executable)except:print ('"%s" from %s does not point to a valid installation of Caffe.'% (value, envvar))print 'Use the envvar CAFFE_ROOT to indicate a valid installation.'raisereturn executable, version, flavordef load_from_path():"""Load information from an installation on standard paths (PATH and PYTHONPATH)"""try:executable = find_executable_in_dir()if executable is None:raise ValueError('Caffe executable not found in PATH')if not is_pycaffe_in_dir():raise ValueError('Pycaffe not found in PYTHONPATH')import_pycaffe()version, flavor = get_version_and_flavor(executable)except:print 'A valid Caffe installation was not found on your system.'print 'Use the envvar CAFFE_ROOT to indicate a valid installation.'raisereturn executable, version, flavordef find_executable_in_dir(dirname=None):"""Returns the path to the caffe executable at dirnameIf dirname is None, search all directories in sys.pathReturns None if not found"""if platform.system() == 'Windows':exe_name = 'caffe.exe'else:exe_name = 'caffe'if dirname is None:dirnames = [path.strip("\"' ") for path in os.environ['PATH'].split(os.pathsep)]else:dirnames = [dirname]for dirname in dirnames:path = os.path.join(dirname, exe_name)if os.path.isfile(path) and os.access(path, os.X_OK):return pathreturn Nonedef is_pycaffe_in_dir(dirname=None):"""Returns True if you can "import caffe" from dirnameIf dirname is None, search all directories in sys.path"""old_path = sys.pathif dirname is not None:sys.path = [dirname] # temporarily replace sys.pathtry:imp.find_module('caffe')except ImportError:return Falsefinally:sys.path = old_pathreturn Truedef import_pycaffe(dirname=None):"""Imports caffeIf dirname is not None, prepend it to sys.path first"""if dirname is not None:sys.path.insert(0, dirname)# Add to PYTHONPATH so that build/tools/caffe is aware of python layers thereos.environ['PYTHONPATH'] = '%s%s%s' % (dirname, os.pathsep, os.environ.get('PYTHONPATH'))# Suppress GLOG output for python bindingsGLOG_minloglevel = os.environ.pop('GLOG_minloglevel', None)# Show only "ERROR" and "FATAL"os.environ['GLOG_minloglevel'] = '2'# for Windows environment, loading h5py before caffe solves the issue mentioned in# https://github.com/NVIDIA/DIGITS/issues/47#issuecomment-206292824import h5py # noqatry:import caffeexcept ImportError:print 'Did you forget to "make pycaffe"?'raise# Strange issue with protocol buffers and pickle - see issue #32sys.path.insert(0, os.path.join(os.path.dirname(caffe.__file__), 'proto'))# Turn GLOG output back on for subprocess callsif GLOG_minloglevel is None:del os.environ['GLOG_minloglevel']else:os.environ['GLOG_minloglevel'] = GLOG_minlogleveldef get_version_and_flavor(executable):"""Returns (version, flavor)Should be called after import_pycaffe()"""version_string = get_version_from_pycaffe()if version_string is None:version_string = get_version_from_cmdline(executable)if version_string is None:version_string = get_version_from_soname(executable)if version_string is None:raise ValueError('Could not find version information for Caffe build ' +'at "%s". Upgrade your installation' % executable)#這部分代碼沒用,但是會出現bug,我就注釋了#version = parse_version(version_string)#if parse_version(0, 99, 0) > version > parse_version(0, 9, 0):# flavor = 'NVIDIA'# minimum_version = '0.11.0'# if version < parse_version(minimum_version):# raise ValueError(# 'Required version "%s" is greater than "%s". Upgrade your installation.'# % (minimum_version, version_string))#else:# flavor = 'BVLC'flavor = 'BVLC'return version_string, flavordef get_version_from_pycaffe():try:from caffe import __version__ as versionreturn versionexcept ImportError:return Nonedef get_version_from_cmdline(executable):command = [executable, '-version']p = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)if p.wait():print p.stderr.read().strip()raise RuntimeError('"%s" returned error code %s' % (command, p.returncode))pattern = 'version'for line in p.stdout:if pattern in line:return line[line.find(pattern) + len(pattern) + 1:].strip()return Nonedef get_version_from_soname(executable):command = ['ldd', executable]p = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)if p.wait():print p.stderr.read().strip()raise RuntimeError('"%s" returned error code %s' % (command, p.returncode))# Search output for caffe librarylibname = 'libcaffe'caffe_line = Nonefor line in p.stdout:if libname in line:caffe_line = linebreakif caffe_line is None:raise ValueError('libcaffe not found in linked libraries for "%s"'% executable)# Read the symlink for libcaffe from ldd outputsymlink = caffe_line.split()[2]filename = os.path.basename(os.path.realpath(symlink))# parse the version stringmatch = re.match(r'%s(.*)\.so\.(\S+)$' % (libname), filename)if match:return match.group(2)else:return None #看這里,看這里,一個路徑問題 #我們需要在環境變量里聲明一下,CAFFE_ROOT 或者 CAFFE_HOME都可以,指向caffe編譯后的 ./Build/x64/Release if 'CAFFE_ROOT' in os.environ:executable, version, flavor = load_from_envvar('CAFFE_ROOT') elif 'CAFFE_HOME' in os.environ:executable, version, flavor = load_from_envvar('CAFFE_HOME') else:executable, version, flavor = load_from_path()option_list['caffe'] = {'executable': executable,'version': version,'flavor': flavor,'multi_gpu': (flavor == 'BVLC' or parse_version(version) >= parse_version(0, 12)),'cuda_enabled': (len(device_query.get_devices()) > 0), }
  • 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的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。