MATLAB Answers

call python script contains pytorch module

48 views (last 30 days)
Hanzhong Zheng
Hanzhong Zheng on 25 Oct 2019
Answered: Vimal Rathod on 30 Oct 2019
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

  0 Comments

Sign in to comment.

Answers (1)

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

  0 Comments

Sign in to comment.

Sign in to answer this question.