Run pytorch gpu in Matlab

조회 수: 6 (최근 30일)
Moritz Scherrmann
Moritz Scherrmann 2020년 5월 12일
답변: Hrishikesh Borate 2021년 2월 5일
I would ike to use pytorch with gpu support in Matlab. I use Anaconda and I created a virtual environment with the following packages (among others):
  • numpy 1.18.4
  • torch 1.5.0+cu101
  • torchvision 0.6.0+cu101
The virtual environment runs on Python 3.7. I use a Nvidia Geforce 2080 Ti RTX with CUDA 10.1.
Running
py.importlib.import_module('torch')
in Matlab yields the following error message:
Error using __init__ (line 364)
Python Error: OSError: [WinError 127] Die angegebene Prozedur wurde nicht gefunden
Error in __init__><module> (line 81)
Error in <frozen importlib>_call_with_frames_removed (line 219)
Error in <frozen importlib>exec_module (line 728)
Error in <frozen importlib>_load_unlocked (line 677)
Error in <frozen importlib>_find_and_load_unlocked (line 967)
Error in <frozen importlib>_find_and_load (line 983)
Error in <frozen importlib>_gcd_import (line 1006)
Error in __init__>import_module (line 127)
Running
pyversion
shows that Matlab indeed works with the Python version of the virtual environment.
Note:
  • Importing torch in a python console works fine.
  • Installing the cpu version of pytorch works also, but I need the gpu support.
  • Import any other package works too.
I would be very grateful for any kind of help!
  댓글 수: 2
Rayan El Helou
Rayan El Helou 2020년 6월 14일
Any luck since then?
Moritz Scherrmann
Moritz Scherrmann 2020년 6월 15일
Unfortunately not

댓글을 달려면 로그인하십시오.

답변 (1개)

Hrishikesh Borate
Hrishikesh Borate 2021년 2월 5일
Hi,
Refer to the following answer.

카테고리

Help CenterFile Exchange에서 Call Python from MATLAB에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by