1. 编译环境配置

软件需求:

  1. Matlab 2019b
  2. cudnn cudnn-10.1-windows10-x64-v7.6.4.38
  3. TensorRT-6.0.1.5.Windows10.x86_64.cuda-10.1.cudnn7.6
  4. Cuda 10.1 cuda_10.1.105_418.96_win10

下载路径。

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

  1. 将cudnn的lib,bin,include复制到cuda包含相同目录下。
  2. 将tensort 文件夹复制到cuda\v10.1 下面;同时将tensort 下的lib文件夹中的dll拷贝到cuda\v10.1\bin里边。

---------------------------------------------------------------------------------------------------------------

配置环境变量:

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!

  1. 错误处理

在命令行里,直接输入 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"

  1. Nvcc  —V错误

https://blog.csdn.net/jinshelj/article/details/80193021

  1. 配置环境

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: '

  1. 网络资源链接

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

    1. MATLAB资源
  • MATLAB Onramp(2小时入门教程)
  • 深度学习Onramp(2小时入门教程)
  • 使用MATLAB进行深度学习(16小时深入课程)
  • 深度学习工具箱(文档)
  • 深度学习应用程序库(代码示例)
  • MATLAB Online(在浏览器中使用MATLAB)
  • MATLAB Grader(自动对MATLAB代码分配进行评分)
  • 数据科学,深度学习  和机器学习的最新功能和资源(最新发布的产品功能)
  • 深度学习(博客)

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建议的环境要求及工具包使用情况。翻译成中文是:

  1. 打开DL Toolbox

在matlab命令框输入:deepNetworkDesigner

如果需要使用alexnet,则需要下载deeplearning for alexnet工具箱

1)需要MATLAB

2)建议使用并行计算工具箱,这是GPU支持所需的图像处理工具箱

3)计算机视觉工具箱推荐

4)GPU编码器推荐

5)MATLAB编码器推荐

6)Simulink推荐

7)建议使用强化学习工具箱

另一方面,matlab还可以利用第三方已经实现好的一些模型处理一般场景。比如用训练好的googLeNet来识别图片,或识别摄像头里的动态场景。

  1. GPU coder cnncodegen工具

生产C++代码用于树莓派arm处理器;

cnncodegen(net,xx,xxx)

  1. Squeezenet

轻量级压缩网络

  1. DeepNetwork Designer
  2. 1.5 ONNX开放式的神经网络交换

ImportONNXnetwork

  1. 调用其它现有网络
  1. 打开get more app输入Transfer Learning,进行下载迁移学习工具箱。

版本 2019.6.2 (1.17 MB) 作者: Kevin Chng

Transfer Learning of Pre-trained Neural Network or Imported ONNX Classification Model in GUI

  1. 例子搜索,Get Started with Transfer Learning
    1. matlab调用keras深度学习模型(环境搭建)
    2. MATLAB对Alexnet模型进行迁移学习  https://blog.csdn.net/qq_41569159/article/details/89048904
    3. 在matlab上使用自己的数据进行迁移学习  https://blog.csdn.net/weixin_38538305/article/details/84730078基于Matlab的AlexNet图像迁移学习
    4. 基于Matlab的AlexNet图像迁移学习
    5. 手把手教你用matlab做深度学习 https://blog.csdn.net/caokaifa/article/details/81155584
    6. https://www.cnblogs.com/nwpuxuezha/p/7834344.html

    7. https://github.com/JiJingYu

【1】Matlab深度学习环境配置-入门相关推荐

  1. 深度学习环境配置超详细教程【Anaconda+PyTorch(GPU版)+CUDA+cuDNN】

    深度学习环境配置 入门深度学习,首先要做的事情就是要搭建深度学习的环境.不管你是Windows用户,Mac用户还是Ubuntu用户,只要电脑配置允许,都可以做深度学习,毕竟Windows.Mac和Ub ...

  2. 深度学习环境配置指南!(Windows、Mac、Ubuntu全讲解)

    ↑↑↑关注后"星标"Datawhale 每日干货 & 每月组队学习,不错过 Datawhale干货 作者:伍天舟.马曾欧.陈信达 入门深度学习,很多人经历了从入门到放弃的心 ...

  3. 【深度学习】相当全面的深度学习环境配置指南!(Windows、Mac、Ubuntu全讲解)...

    作者:伍天舟.马曾欧.陈信达 入门深度学习,很多人经历了从入门到放弃的心酸历程,且千军万马倒在了入门第一道关卡:环境配置问题.俗话说,环境配不对,学习两行泪. 如果你正在面临配置环境的痛苦,不管你是W ...

  4. 保姆级教程:深度学习环境配置指南!(Windows、Mac、Ubuntu全讲解)

    点击上方"小白学视觉",选择加"星标"或"置顶" 重磅干货,第一时间送达 入门深度学习,很多人经历了从入门到放弃的心酸历程,且千军万马倒在了 ...

  5. 基于Ubuntu 18.04机器人操作系统环境和深度学习环境配置

    基于Ubuntu 18.04机器人操作系统环境和深度学习环境配置详解 CUDA+Cudnn+ROS+anaconda+ubuntu装机必备 笔记本双系统安装 U盘启动项安装ubuntu18.04.1 ...

  6. 【20210122期AI简报】保姆级深度学习环境配置指南、寒武纪首颗AI训练芯片亮相...

    导读:本期为 AI 简报 20210122 期,将为您带来 9 条相关新闻,新增论文推送,在文章底部,祝各位牛年大吉~ 本文一共 3700 字,通篇阅读结束需要 7~10 分钟 1. 保姆级教程:深度 ...

  7. 【深度学习环境配置】Anaconda +Pycharm + CUDA +cuDNN + Pytorch + Opencv(资源已上传)

    文章目录 一.推荐系列 1.1.大神视频详细讲解 1.2.最全最简易的保姆教程 1.3.百度网盘资源 二.环境配置 2.0.查看已安装软件的版本号 2.1.Anaconda安装 2.2.Pycharm ...

  8. Ubuntu 深度学习环境配置、Theano TensorFlow PyTorch 安装、常用软件安装方式

    文章目录 介绍 系统和显卡 深度学习环境配置 安装 Nvidia 显卡驱动 安装 CDUA 安装 cuDNN 深度学习框架安装 安装 Theano-gpu 安装 TensorFlow-gpu 安装 P ...

  9. 2080Ti深度学习环境配置及常用软件安装

    2080Ti深度学习环境配置及常用软件安装 ubuntu 16.04 双系统的安装(已有window10系统) 显卡驱动安装 tensorflow安装 teamviewer安装 pycharm安装 m ...

  10. 双系统Ubuntu22.04深度学习环境配置与踩坑记录

    双系统Ubuntu22.04深度学习环境配置踩坑记录 前言 目录 相关版本 主要参考教程 Ubuntu安装 Nvidia和CUDA安装 踩坑经历 官网安装所遇问题 cuDNN安装 Anaconda安装 ...

最新文章

  1. 王劲对外发声:确已离开景驰,不是因为百度诉讼
  2. python处理excel文件-python处理Excel文件
  3. 密码篇——非对称加密
  4. 二十五、Node中的Buffer缓冲器和EventEmitter事件触发器
  5. 正确设置JUnit测试名称
  6. github java开源项目经验_3月份GitHub上最热门的Java开源项目
  7. visual studio2017调用SDK各个操作步骤的作用
  8. Java设计模式学习总结(14)——结构型模式之代理模式
  9. mockito无效_Mockito模拟无效方法
  10. 读取浏览器cookies的python脚本
  11. Js中去除数组中重复元素的4种方法
  12. 3dmax一键展uv_3Dmax批量展开场景物体的第二套UV
  13. R语言入门-常用的向量运算
  14. 用excel制作双层饼图_Excel中怎么绘制双层饼图?
  15. c++ vtable 深入解析
  16. java 转pem_将Java密钥库转换为PEM格式
  17. “去中心化”和“分布式”的区别
  18. 关于软件产品化的几点思考【转】
  19. ShapeAlias
  20. cassandra(scylladb)数据备份和还原

热门文章

  1. java项目开发的生命周期
  2. FFMpeg视频格式讲解
  3. div+css页面布局实战
  4. html创建qq注册页面,用javascript制作qq注册动态页面
  5. PHP安装Xdebug调试工具
  6. 光伏发电最大功率点(MPPT)跟踪技术
  7. GRE阅读-GRE佛脚备考系列之阅读分册volume 2-机经练习(1)
  8. 短信轰渣器搭建源码下载
  9. excel 第六次人口普查_计算机二级考试真题-Excel-第六次人口普查数据的统计分析...
  10. 良心安利陶瓷材质贴图素材网站