【发布时间】:2020-08-21 21:33:10
【问题描述】:
我正在尝试运行需要pytorch-gpu 的python 包。我已将 Colab 笔记本的运行时类型更改为 GPU。当我运行命令时,我面临以下错误。不确定我是否能够自己在 colab 上构建 pytorch?
Traceback (most recent call last):
File "inference_unet.py", line 9, in <module>
import torchvision.transforms as transforms
File "/usr/local/lib/python3.6/dist-packages/torchvision/__init__.py", line 10, in <module>
from .extension import _HAS_OPS
File "/usr/local/lib/python3.6/dist-packages/torchvision/extension.py", line 58, in <module>
_check_cuda_version()
File "/usr/local/lib/python3.6/dist-packages/torchvision/extension.py", line 54, in _check_cuda_version
.format(t_major, t_minor, tv_major, tv_minor))
RuntimeError: Detected that PyTorch and torchvision were compiled with different CUDA versions. PyTorch has CUDA Version=10.2 and torchvision has CUDA Version=10.1. Please reinstall the torchvision that matches your PyTorch install.
【问题讨论】:
标签: pytorch google-colaboratory