call python script contains pytorch module

5 次查看(过去 30 天)
Hello,
I am calling a python script, which uses the pytorch module, but it generates error:
"Traceback (most recent call last):
File "/Users/zhengh3/Documents/MATLAB/afreg/kronecker_product.py", line 2, in <module>
import torch
ImportError: No module named torch"
I have tried to change the current pyversion to the path where I installed the pytorch. Is there anyway the matlab will recognize the torch.
Thank you so much!
Hanzhong

回答(1 个)

Vimal Rathod
Vimal Rathod 2019-10-30
You can refer to the following link to get more understanding on calling python library functions:
Hope this helps!

类别

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