我要使用deepsaber。 为此,我必须安装Torch。
我使用pip install torch torchvision
完成了此操作。
运行cd scripts/generation
和./script_generate.sh [path to song]
之后,python告诉我:
Traceback (most recent call last):
File "generate_stage1.py", line 16, in <module>
from models import create_model
File "/home/server/deepsaber/models/__init__.py", line 2, in <module>
from .base_model import BaseModel
File "/home/server/deepsaber/models/base_model.py", line 2, in <module>
import torch
ModuleNotFoundError: No module named 'torch'
Traceback (most recent call last):
File "generate_stage2.py", line 16, in <module>
from models import create_model
File "/home/server/deepsaber/models/__init__.py", line 2, in <module>
from .base_model import BaseModel
File "/home/server/deepsaber/models/base_model.py", line 2, in <module>
import torch
ModuleNotFoundError: No module named 'torch'
使用import torch
时,使用python
就像是一种魅力
关于我能做什么的任何想法?
存储库说:
火炬(作为火炬或通过https://pytorch.org/get-started/locally/安装)
答案 0 :(得分:0)
您很有可能使用Python 2安装了torch
,而script_generate.sh
使用了Python 3(请参阅here):
# [...]
py=python3
# [...]
尝试运行pip3 install torch torchvision
或python3 -m pip install torch torchvision
。另外,在使用import torch
时检查python3
是否工作。