从零搭建完整 AI 开发环境,写出第一个 AI 应用-之遇到的问题及解决--已弃

之后放弃了,还没成功

 

学习链接:http://www.sohu.com/a/249136079_629694   

配置 AI 开发环境

安装要求  /满足

从零搭建完整 AI 开发环境,写出第一个 AI 应用-之遇到的问题及解决--已弃_第1张图片

检查并安装Git  /满足

Git 安装页面:https://git-scm.com/download/win

从零搭建完整 AI 开发环境,写出第一个 AI 应用-之遇到的问题及解决--已弃_第2张图片

检查并安装NVIDIA显示机器学习包   /满足

从零搭建完整 AI 开发环境,写出第一个 AI 应用-之遇到的问题及解决--已弃_第3张图片

 

1.确认显卡是NVIDIA,并支持cuda /满足

2.安装NVIDIA机器学习相关组件     /满足 

         满足

     满足

CUDA 9.0 下载页面:https://developer.nvidia.com/cuda-90-download-archive

          满足     

  满足

  满足

假如要进入E盘 USERPROFILE文件夹

d

p.s.要是之前已经下载好了微软ai样例库,进入USERPROFILE文件夹之后,键入命令进入samples-for-ai文件夹,执行2.运行安装脚本

 

这里,是两句代码,分开的,不像链接里一样连着的

 

第一句

 

 

git clone https://github.com/Microsoft/samples-for-ai.git

第二句

cd samples-for-ai

 

这里,直接在以管理员身份运行的cmd中键入即可

python installer/install.py

这里,是以管理员身份运行的cmd中键入

 

 

(3)检查并配置 CUDA,cuDNN

之前下载安装CUDA,cuDNN没有重启,执行install.py时总是报错。重启后,进入samples-for-ai文件夹,再执行2.运行安装脚本,就没有报错了。

如下:

E:\USERPROFILE\samples-for-ai>python installer/install.py
15:40:13 [INFO] [Microsoft Visual Studio Tools for AI] Detecting system information ...
15:40:13 [INFO] [Microsoft Visual Studio Tools for AI] Python: 3.6.6, 64bit
15:40:13 [INFO] [Microsoft Visual Studio Tools for AI] OS: Windows-10, 64bit
15:40:14 [INFO] [Microsoft Visual Studio Tools for AI] NVIDIA GPU: Find 1 GPU device(s) that meet the compute capability requirement.
15:40:14 [INFO] [Microsoft Visual Studio Tools for AI] Git: True
15:40:14 [INFO] [Microsoft Visual Studio Tools for AI] Visual Studio: VS2017
15:40:14 [INFO] [Microsoft Visual Studio Tools for AI] CUDA: 9.0
15:40:14 [INFO] [Microsoft Visual Studio Tools for AI] Cudnn: 7
15:40:14 [INFO] [Microsoft Visual Studio Tools for AI] Begin to install scipy(numpy, scipy) ...
15:40:14 [INFO] [Microsoft Visual Studio Tools for AI] Begin to install CNTK(BrainScript) ...
15:40:14 [INFO] [Microsoft Visual Studio Tools for AI] Begin to pip-install numpy 1.14.3 ...
15:40:14 [INFO] [Microsoft Visual Studio Tools for AI] CNTK(BrainScript)-2.5.1 is already installed.
15:40:17 [INFO] [Microsoft Visual Studio Tools for AI] Pip-install numpy 1.14.3 successfully!
15:40:17 [INFO] [Microsoft Visual Studio Tools for AI] Begin to pip-install scipy 1.1.0 ...
15:40:18 [INFO] [Microsoft Visual Studio Tools for AI] Pip-install scipy 1.1.0 successfully!
15:40:18 [INFO] [Microsoft Visual Studio Tools for AI] Begin to pip-install cntk-gpu 2.5.1 ...
15:40:19 [INFO] [Microsoft Visual Studio Tools for AI] Pip-install cntk-gpu 2.5.1 successfully!
15:40:19 [INFO] [Microsoft Visual Studio Tools for AI] Begin to pip-install tensorflow-gpu 1.5.0 ...
15:40:20 [INFO] [Microsoft Visual Studio Tools for AI] Pip-install tensorflow-gpu 1.5.0 successfully!
15:40:20 [INFO] [Microsoft Visual Studio Tools for AI] Begin to pip-install torch 0.4.0 ...
15:43:33 [INFO] [Microsoft Visual Studio Tools for AI] Pip-install torch 0.4.0 successfully!
15:43:33 [INFO] [Microsoft Visual Studio Tools for AI] Begin to pip-install torchvision 0.2.1 ...
15:44:12 [INFO] [Microsoft Visual Studio Tools for AI] Pip-install torchvision 0.2.1 successfully!
15:44:12 [INFO] [Microsoft Visual Studio Tools for AI] Begin to pip-install mxnet-cu90 1.2.0 ...
15:44:13 [INFO] [Microsoft Visual Studio Tools for AI] Pip-install mxnet-cu90 1.2.0 successfully!
15:44:13 [INFO] [Microsoft Visual Studio Tools for AI] Begin to install chainer(cupy, chainer) ...
15:44:13 [WARNING] [Microsoft Visual Studio Tools for AI] On windows, please manually install cupy. You can reference this link https://github.com/Microsoft/vs-tools-for-ai/blob/master/docs/prepare-localmachine.md#chainer.
15:44:13 [INFO] [Microsoft Visual Studio Tools for AI] Begin to pip-install chainer 4.1.0 ...
15:44:14 [INFO] [Microsoft Visual Studio Tools for AI] Pip-install chainer 4.1.0 successfully!
15:44:14 [INFO] [Microsoft Visual Studio Tools for AI] Begin to pip-install Theano 1.0.2 ...
15:44:14 [INFO] [Microsoft Visual Studio Tools for AI] Pip-install Theano 1.0.2 successfully!
15:44:14 [INFO] [Microsoft Visual Studio Tools for AI] Begin to pip-install Keras 2.1.6 ...
15:44:15 [INFO] [Microsoft Visual Studio Tools for AI] Pip-install Keras 2.1.6 successfully!
15:44:15 [INFO] [Microsoft Visual Studio Tools for AI] Begin to pip-install caffe2 0.8.1 ...
15:44:16 [INFO] [Microsoft Visual Studio Tools for AI] Pip-install caffe2 0.8.1 successfully!
15:44:16 [INFO] [Microsoft Visual Studio Tools for AI] Begin to install ml software(scikit-learn, xgboost and libsvm) ...
15:44:16 [INFO] [Microsoft Visual Studio Tools for AI] Begin to pip-install scikit-learn 0.19.1 ...
15:44:17 [INFO] [Microsoft Visual Studio Tools for AI] Pip-install scikit-learn 0.19.1 successfully!
15:44:17 [INFO] [Microsoft Visual Studio Tools for AI] Begin to pip-install xgboost 0.71 ...
15:44:18 [INFO] [Microsoft Visual Studio Tools for AI] Pip-install xgboost 0.71 successfully!
15:44:18 [INFO] [Microsoft Visual Studio Tools for AI] Begin to pip-install libsvm 3.22 ...
15:44:18 [INFO] [Microsoft Visual Studio Tools for AI] Pip-install libsvm 3.22 successfully!
15:44:18 [INFO] [Microsoft Visual Studio Tools for AI] Begin to install converter(coremltools, onnx, tf2onnx, onnxmltools and winmltools) ...
15:44:18 [INFO] [Microsoft Visual Studio Tools for AI] Begin to pip-install coremltools 0.8 ...
15:44:38 [INFO] [Microsoft Visual Studio Tools for AI] Pip-install coremltools 0.8 successfully!
15:44:38 [INFO] [Microsoft Visual Studio Tools for AI] Begin to pip-install onnx 1.1.2 ...
15:44:39 [INFO] [Microsoft Visual Studio Tools for AI] Pip-install onnx 1.1.2 successfully!
15:44:40 [INFO] [Microsoft Visual Studio Tools for AI] onnxmltools is already installed.
15:44:40 [INFO] [Microsoft Visual Studio Tools for AI] winmltools is already installed.
15:44:40 [INFO] [Microsoft Visual Studio Tools for AI] tf2onnx is already installed. We will uninstall it and upgrade to the latest version.
15:44:40 [INFO] [Microsoft Visual Studio Tools for AI] Begin to pip-uninstall tf2onnx 0.0.0.1 ...
15:44:41 [INFO] [Microsoft Visual Studio Tools for AI] Pip-uninstall tf2onnx 0.0.0.1 successfully!
15:44:41 [INFO] [Microsoft Visual Studio Tools for AI] Begin to pip-install tf2onnx 0.0.0.1 ...
15:45:11 [INFO] [Microsoft Visual Studio Tools for AI] Pip-install tf2onnx 0.0.0.1 successfully!
15:45:11 [INFO] [Microsoft Visual Studio Tools for AI] Begin to install extra software(jupyter, matplotlib, and pandas) ...
15:45:11 [INFO] [Microsoft Visual Studio Tools for AI] jupyter is already installed.
15:45:11 [INFO] [Microsoft Visual Studio Tools for AI] matplotlib is already installed.
15:45:11 [INFO] [Microsoft Visual Studio Tools for AI] pandas is already installed.
15:45:11 [INFO] [Microsoft Visual Studio Tools for AI] Setup finishes.

训练第一个模型

 

python examples/tensorflow/mnist/mnist.py

如下

E:\USERPROFILE\samples-for-ai>python examples/tensorflow/mnist/mnist.py
Extracting input\train-images-idx3-ubyte.gz
Extracting input\train-labels-idx1-ubyte.gz
Extracting input\t10k-images-idx3-ubyte.gz
Extracting input\t10k-labels-idx1-ubyte.gz
2019-03-04 16:12:37.329737: I C:\tf_jenkins\workspace\rel-win\M\windows-gpu\PY\36\tensorflow\core\platform\cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX AVX2
2019-03-04 16:12:37.499119: I C:\tf_jenkins\workspace\rel-win\M\windows-gpu\PY\36\tensorflow\core\common_runtime\gpu\gpu_device.cc:1105] Found device 0 with properties:
name: P106-100 major: 6 minor: 1 memoryClockRate(GHz): 1.7085
pciBusID: 0000:01:00.0
totalMemory: 5.93GiB freeMemory: 5.85GiB
2019-03-04 16:12:37.508505: I C:\tf_jenkins\workspace\rel-win\M\windows-gpu\PY\36\tensorflow\core\common_runtime\gpu\gpu_device.cc:1195] Creating TensorFlow device (/device:GPU:0) -> (device: 0, name: P106-100, pci bus id: 0000:01:00.0, compute capability: 6.1)
Initialized!
2019-03-04 16:12:39.164762: E C:\tf_jenkins\workspace\rel-win\M\windows-gpu\PY\36\tensorflow\stream_executor\cuda\cuda_dnn.cc:378] Loaded runtime CuDNN library: 7402 (compatibility version 7400) but source was compiled with 7003 (compatibility version 7000).  If using a binary install, upgrade your CuDNN library to match.  If building from sources, make sure the library loaded at runtime matches a compatible version specified during compile configuration.
2019-03-04 16:12:39.179955: F C:\tf_jenkins\workspace\rel-win\M\windows-gpu\PY\36\tensorflow\core\kernels\conv_ops.cc:717] Check failed: stream->parent()->GetConvolveAlgorithms( conv_parameters.ShouldIncludeWinogradNonfusedAlgo(), &algorithms)

 

你可能感兴趣的:(从零搭建完整 AI 开发环境,写出第一个 AI 应用-之遇到的问题及解决--已弃)