MATLAB Answers

Internal error in deep neural network quantification?

29 views (last 30 days)
cui
cui on 5 Aug 2020
my env:
  • win10 x64
  • matlab2020a
  • cuda version:11.0
nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2020 NVIDIA Corporation
Built on Wed_May__6_19:10:02_Pacific_Daylight_Time_2020
Cuda compilation tools, release 11.0, V11.0.167
Build cuda_11.0_bu.relgpu_drvr445TC445_37.28358933_0
  • cudnn version:8.0.0
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.0\include\cudnn_version.h
#define CUDNN_MAJOR 8
#define CUDNN_MINOR 0
#define CUDNN_PATCHLEVEL 0
#define CUDNN_VERSION (CUDNN_MAJOR * 1000 + CUDNN_MINOR * 100 + CUDNN_PATCHLEVEL)
#endif /* CUDNN_VERSION_H */
repruduce error:
When I use the "dlquantizer" function, the following unexpected error occurs. Why?
dlquantizer(resnet50);
Unable to resolve the name dltargets.cudnn.SupportedLayerImpl.m_sourceFiles.
Error in coder.internal.getSupportedLayerTypes
Error in dlquantization.internal.utils.datavalidators.NetworkValidator/checkUnsupportedLayers
Error in dlquantization.internal.utils.datavalidators.NetworkValidator/validate
Error in dlquantizer (line 95)
netValidator.validate();
check my env:
coder.checkGpuInstall('full')
Compatible GPU : PASSED
CUDA Environment : PASSED
Runtime : PASSED
cuFFT : PASSED
cuSOLVER : PASSED
cuBLAS : PASSED
cuDNN Environment : PASSED (Warning: Deep learning code generation has been tested with cuDNN v7.5. The provided cuDNN library v8.0 may not be fully compatible.)
TensorRT Environment : FAILED (Unable to find the 'NVIDIA_TENSORRT' environment variable. Set 'NVIDIA_TENSORRT' to point to the root directory of a TensorRT installation.)
Profiling Environment : PASSED
Basic Code Generation : FAILED (Test GPU code generation failed with the error 'emlc:compilationError'. View report for further information: View report)
ans =
struct with fields:
gpu: 1
cuda: 1
cudnn: 1
tensorrt: 0
basiccodegen: 0
basiccodeexec: 0
deepcodegen: 0
deepcodeexec: 0
tensorrtdatatype: 0
profiling: 1
Then I open the above wrong report:
Do I have to install the old version of cuda10?

  0 Comments

Sign in to comment.

Answers (1)

MathWorks Fixed Point Team
To avoid a ‘coder.internal.getSupportedLayerTypes’ error on creation of a dlquantizer object, install the ‘GPU Coder Interface for Deep Learning Libraries’. https://www.mathworks.com/matlabcentral/fileexchange/68642-gpu-coder-interface-for-deep-learning-libraries
You can verify that the addon is installed and enabled by executing in the MATLAB command window:
addons = matlab.addons.installedAddons

  2 Comments

cui
cui on 20 Aug 2020
After installing the "GPU Coder interface for Deep Learning Libraries" above, there is no error, but I followed another tutorial step, and finally quantified an error. The screenshot is as follows. Why?
cfg = coder.gpuConfig('mex');
cfg.TargetLang = 'C++';
cfg.GpuConfig.ComputeCapability = '6.1';
cfg.DeepLearningConfig = coder.DeepLearningConfig('cudnn');
cfg.DeepLearningConfig.AutoTuning = true;
cfg.DeepLearningConfig.CalibrationResultFile = './myquantObj.mat';
cfg.DeepLearningConfig.DataType = 'int8';
codegen -config cfg -args {coder.Constant('mynet.mat'),ones(imageSize)} predict_int8 % ??? Invalid CUDA toolkit version found in system path for MEX compilation. CUDA v11 was found, but CUDA v10 is required for MEX builds.
??? Invalid CUDA toolkit version found in system path for MEX compilation. CUDA v11 was found, but CUDA v10 is required for MEX builds.
Code generation failed: View Error Report
Error using codegen
Error in quantizeModel (line 83)
codegen -config cfg -args {coder.Constant('mynet.mat'),ones(imageSize)} predict_int8
Is the essential problem caused by the CUDA version?
Hanumanth Hanumantharayappa
Hi Cui,
Yes, this problem is caused by the CUDA and CuDNN version you are using . You need CUDA v10.1 and and CuDNN 7.5. Let me know if this resolves your issue.
Hanumanth

Sign in to comment.

Products


Release

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!