软件需求:
下载路径。
Maltab GPU 环境要求https://ww2.mathworks.cn/help/gpucoder/gs/install-prerequisites.html
CUDNN https://developer.nvidia.com/rdp/cudnn-archive
TenosRThttps://developer.nvidia.com/nvidia-tensorrt-5x-download
CUDA https://developer.nvidia.com/cuda-toolkit-archive
https://blog.csdn.net/charlotteYue/article/details/106146482
Matlab深度学习入门之树莓派与GPU应用。
打开cmd nvcc –version 或者 nvcc -V ,nvidia-smi ,nvidia-smi -q
NVIDIA-SMI 419.67 Driver Version: 442.19
---------------------------------------------------------------------------------------------------------------
配置环境变量:
CUDA_PATH= C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1
CUDA_PATH_V10_1= C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1
NVIDIA_CUDNN= C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1
NVIDIA_TENSORRT= C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\TensorRT
在Path下添加:
打开matlab 进行输入以下命令
mex -setup:' D:\ProgramFiles\MATLAB\R2019b\bin\win64\mexopts\msvc2017.xml' C -v
coder.checkGpuInstall('gpu','codegen','cudnn','quiet');
gpuDeviceCount
CUDA_PATH |
Path to the CUDA® toolkit installation. For example: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\ |
NVIDIA_CUDNN |
Path to the root folder of cuDNN installation. The root folder contains the bin, include, and lib subfolders. For example: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\cuDNN\ |
NVIDIA_TENSORRT |
Path to the root folder of TensorRT installation. The root folder contains the bin, data, include, and lib subfolders. For example: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\TensorRT\ |
OPENCV_DIR |
Path to the build folder of OpenCV on the host. This variable is required for building and running deep learning examples. For example: C:\Program Files\opencv\build |
PATH |
Path to the CUDA executables. Generally, the CUDA toolkit installer sets this value automatically. For example: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\bin |
Path to the cudnn.dll dynamic library. The name of this library may be different on your installation. For example: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\cuDNN\bin |
|
Path to the nvinfer* dynamic libraries of TensorRT. The name of this library may be different on your installation. For example: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\TensorRT\lib |
|
Path to the Dynamic-link libraries (DLL) of OpenCV. This variable is required for running deep learning examples. For example: C:\Program Files\opencv\build\x64\vc15\bin |
Hi there, I was trapped in this error within the whole day. I'm using yolo to dectect objects, while I'm just using it but not trying to compile it. So when I used single or multiple CPUs to run the vehicle_Dataset, I found the training process was unable to be accomplished as matlab was out of memory.
So I turned to try to deploy the taining using my GPU, which is Geforce GTX 1060. I installed the new divers for this Graphic card(ver 430.64), CUDA toolkit 10.1, cuDNN v7.5.1 (April 22, 2019) for CUDA 10.1. Then I created
Variable name: CUDA_PATH
Variable value: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1
in the system variables. Also, I added
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\lib\x64
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\extras\CUPTI\lib64
in the Path.
All the add-on on this page was also installed:
https://ww2.mathworks.cn/help/vision/ug/code-generation-for-object-detection-using-yolo-v2.html?searchHighlight=yolo&s_tid=doc_srchtitle
including "GPU Coder Interface for Deep Learning Libraries support package", Microsoft Visual Studio 2017, "MATLAB Support for MinGW-w64 C/C++ Compiler".
Then, I ran the following code in matlab, which worked very good.
mex -setup:'C:\Program Files\MATLAB\R2018b\bin\win64\mexopts\msvc2017.xml' C -v
mex -setup:'C:\Program Files\MATLAB\R2019a\bin\win64\mexopts\msvc2017.xml' C -v
Then I ran
coder.checkGpuInstall('gpu','codegen','cudnn','quiet');
Matlab inform me as
Error using coder.checkGpuInstall (line 32)
One or more of the system checks did not pass, with the following errors ...
Basic Code Generation: (Test GPU code generation failed with the error 'emlc:compilationError'. View report for further information: View report)
So I click the View report, and it says:
Build error: C++ compiler produced errors. See the Build Log for further details.
While the build logs has 1659 lines... I have attached the ecported reports in tha attachment. So I detected the current setup with coder.checkGpuInstall();
Compatible GPU : PASSED
CUDA Environment : PASSED
Runtime : PASSED
cuFFT : PASSED
cuSOLVER : PASSED
cuBLAS : PASSED
cuDNN Environment : PASSED
Basic Code Generation : FAILED (Test GPU code generation failed with the error 'emlc:compilationError'. View report for further information: View report)
So could anyone help me out of this problem? Thanks a lot in advance!
在命令行里,直接输入 nvidia-smi.exe如果不能识别命令,在确保正确安装相应cuda版本的情况下,在环境变量里加入该执行文件路径即可。
即设置Path变量,我的目录为: C:\Program Files\NVIDIA Corporation\NVSMI
So I'm using the provided MATLAB function to check my gpu build but I always end up obtaining this extrange error which says that there is no class or variable "coder". I'm running this under Windows 10 x64, NVIDIA CUDA v10.1 and latest cuDNN libraries on MATLAB R2019a.
coder.checkGpuInstall()
Compatible GPU : PASSED
CUDA Environment : PASSED
Runtime : PASSED
cuFFT : PASSED
cuSOLVER : PASSED
cuBLAS : PASSED
cuDNN Environment : PASSED
Error using coder.checkGpuInstall (line 32)
Undefined variable "coder" or class "coder.gpuConfig"
https://blog.csdn.net/jinshelj/article/details/80193021
coder.checkGpuInstall('gpu','codegen','cudnn','quiet')
% Example:
% gpuEnvObj = coder.gpuEnvConfig;
% gpuEnvObj.GpuId = 1;
% gpuEnvObj.BasicCodegen = 1;
% gpuEnvObj.BasicCodeexec = 1;
% results = coder.checkGpuInstall(gpuEnvObj);
%
Hardware: 'host'
GpuId: 1
BasicCodegen: 1
BasicCodeexec: 0
DeepCodegen: 0
DeepCodeexec: 0
DeepLibTarget: ''
DataType: ''
GenReport: 0
Quiet: 0
Profiling: 0
CudaPath: 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1'
TensorrtPath: ''
NvtxPath: 'C:\Program Files\NVIDIA Corporation\NvToolsExt\'
CudnnPath: '
https://blog.csdn.net/lanluyug/article/details/89516520
https://www.bilibili.com/video/av78056483/ matlab深度学习
使Jupyter Lab(或 Jupyter Notebook)支持Matlab的方法 https://blog.csdn.net/weixin_38538305/article/details/84730078
https://blog.csdn.net/caokaifa?t=1
https://github.com/weiniuzhu/DeepLearning-Converter-for-Darknet-Matlab-Model-Format 各种模型的导入到matlab
https://ww2.mathworks.cn/videos/automated-lidar-point-cloud-annotation-for-sensor-verification-1527491006097.html
https://www.mathworks.com/academia/courseware/teaching-deep-learning-with-matlab.html
https://www.mathworks.com/academia/courseware/modelling-design-control-robotic-mechanisms.html 机器人机构的建模,设计和控制”课件
Maltab GPU 环境要求https://ww2.mathworks.cn/help/gpucoder/gs/install-prerequisites.html
CUDNN https://developer.nvidia.com/rdp/cudnn-archive
TenosRThttps://developer.nvidia.com/nvidia-tensorrt-5x-download
CUDA https://developer.nvidia.com/cuda-toolkit-archive
上述是使用Deep Learning Toolbox建议的环境要求及工具包使用情况。翻译成中文是:
在matlab命令框输入:deepNetworkDesigner
如果需要使用
alexnet
,则需要下载
deeplearning
for alexnet
工具箱
1)需要MATLAB
2)建议使用并行计算工具箱,这是GPU支持所需的图像处理工具箱
3)计算机视觉工具箱推荐
4)GPU编码器推荐
5)MATLAB编码器推荐
6)Simulink推荐
7)建议使用强化学习工具箱
另一方面,matlab还可以利用第三方已经实现好的一些模型处理一般场景。比如用训练好的googLeNet来识别图片,或识别摄像头里的动态场景。
生产C++代码用于树莓派arm处理器;
cnncodegen(net,xx,xxx)
轻量级压缩网络
ImportONNXnetwork
版本 2019.6.2 (1.17 MB) 作者: Kevin Chng
Transfer Learning of Pre-trained Neural Network or Imported ONNX Classification Model in GUI
https://www.cnblogs.com/nwpuxuezha/p/7834344.html
https://github.com/JiJingYu