Why am I unable to load a Python module that requires a certain CUDA version in MATLAB after calling a MATLAB function that uses CUDA enabled GPU?
I am using the Deep Learning Toolbox and GPU computation in MATLAB R2021b with the function "predict".
After calling this function, I wish to load the Python module PyTorch into MATLAB. My PyTorch version is 2.1.2+cu121, which means it comes with and uses CUDA version 12.1.
However, when I run the command to import PyTorch in MATLAB, the following error is thrown.
Error using __init__><module> (line 130)
Python Error: OSError: [WinError 127] The specified procedure could not be
found. Error loading "D:\Program
Files\Python\Python39\lib\site-packages\torch\lib\cudnn_adv_infer64_8.dll" or
one of its dependencies.
Error in <frozen importlib>_call_with_frames_removed (line 228)
Error in <frozen importlib>exec_module (line 850)
Error in <frozen importlib>_load_unlocked (line 680)
Error in <frozen importlib>_find_and_load_unlocked (line 986)
Error in <frozen importlib>_find_and_load (line 1007)
Error in <frozen importlib>_gcd_import (line 1030)
Error in __init__>import_module (line 127)
Why is this error happening and how can I load PyTorch?
Additionally, if I try to load PyTorch before calling "predict", the output of "predict" is different than the output is if I never load "PyTorch". This difference in output is also a concern for me.
Accepted Answer
0 Comments
More Answers (0)
See Also
Categories
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!