问题1:找不到cuda库
Traceback (most recent call last): File "cnn.py", line 5, in <module> import torchvision File "/workspace/jfyuan/tools/espnet/tools/venv/lib/python3.7/site-packages/torchvision/__init__.py", line 1, in <module> from torchvision import models File "/workspace/jfyuan/tools/espnet/tools/venv/lib/python3.7/site-packages/torchvision/models/__init__.py", line 11, in <module> from . import detection File "/workspace/jfyuan/tools/espnet/tools/venv/lib/python3.7/site-packages/torchvision/models/detection/__init__.py", line 1, in <module> from .faster_rcnn import * File "/workspace/jfyuan/tools/espnet/tools/venv/lib/python3.7/site-packages/torchvision/models/detection/faster_rcnn.py", line 7, in <module> from torchvision.ops import misc as misc_nn_ops File "/workspace/jfyuan/tools/espnet/tools/venv/lib/python3.7/site-packages/torchvision/ops/__init__.py", line 1, in <module> from .boxes import nms, box_iou File "/workspace/jfyuan/tools/espnet/tools/venv/lib/python3.7/site-packages/torchvision/ops/boxes.py", line 2, in <module> from torchvision import _C ImportError: /workspace/jfyuan/pytorch/sample/cnn/libs/libcudart.so.9.0: version `libcudart.so.9.0' not found (required by
原因:pytorch是1.3.1,pytorchvision安装的0.3.0,版本不对应导致的
解决:pip install torchvision==0.4.2