当我尝试导入 torchvision 时,出现导入错误。
我用谷歌搜索了这个问题,但除了问题可能出在 Cython 之外,什么也没找到。StackOverflow 搜索也没有找到任何东西。我该如何解决这个问题?
Torchvision version is 0.3.0.
import torchvision
Traceback(最近一次调用最后):文件“/home/ai/PycharmProjects/untitled/TRANSFER.py”,第 4 行,在 import torchvision 文件“/home/ai/anaconda3/envs/reinforcement/lib/python3.5/site -packages/torchvision/ init .py”,第 1 行,从 torchvision 导入模型文件“/home/ai/anaconda3/envs/reinforcement/lib/python3.5/site-packages/torchvision/models/init .py ”,第 11 行,从 . 导入检测文件“/home/ai/anaconda3/envs/reinforcement/lib/python3.5/site-packages/torchvision/models/detection/init.py”,第 1 行,从 .faster_rcnn 导入 * 文件“/home/ai/anaconda3/envs/reinforcement/lib/python3.5/site-packages/torchvision/models/detection/faster_rcnn.py”,第 7 行,从 torchvision.ops 导入 misc 作为 misc_nn_ops 文件“/home/ai/anaconda3/envs/reinforcement/lib/python3.5/site-packages/torchvision/ops/init .py ”,第 1 行,从 .boxes 导入 nms , box_iou 文件“/home/ai/anaconda3/envs/reinforcement/lib/python3.5/site-packages/torchvision/ops/boxes.py”,第 2 行,从 torchvision 导入 _C ImportError: /home/ai/anaconda3 /envs/reinforcement/lib/python3.5/site-packages/torchvision/_C.cpython-35m-x86_64-linux-gnu.so:未定义符号:_PyThreadState_UncheckedGet