call python script contains pytorch module

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 comentario

peng xue
peng xue el 7 de Jun. de 2020
Hi, I have the same problem as you. Have you solved this problem now?

Iniciar sesión para comentar.

Respuestas (1)

Vimal Rathod
Vimal Rathod el 30 de Oct. de 2019

0 votos

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

Categorías

Preguntada:

el 25 de Oct. de 2019

Comentada:

el 7 de Jun. de 2020

Community Treasure Hunt

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

Start Hunting!

Translated by