call python script contains pytorch module

4 ビュー (過去 30 日間)
Hanzhong Zheng
Hanzhong Zheng 2019 年 10 月 25 日
コメント済み: peng xue 2020 年 6 月 7 日
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 件のコメント
peng xue
peng xue 2020 年 6 月 7 日
Hi, I have the same problem as you. Have you solved this problem now?

サインインしてコメントする。

回答 (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 Center および File ExchangeCall Python from MATLAB についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by