火炬视觉导入时未定义符号

时间:2019-07-21 19:02:35

标签: python pip pytorch

pip install torch==0.4.1 -f https://download.pytorch.org/whl/cu100/stable

cat /usr/local/cuda/version.txt
CUDA Version 10.1.168

python -V
Python 3.5.2

python -c "import torch; print(torch.__version__)"
0.4.1

获取错误:

python -c "import torchvision; print(torchvision.__version__)"

    ...
    from torchvision import _C
    ImportError: /my_env/lib/python3.5/site-packages/torchvision/_C.cpython-35m-x86_64-linux-gnu.so: undefined symbol: _ZN6caffe26detail36_typeMetaDataInstance_preallocated_7E

版本:

pip freeze | grep torch
torch==0.4.1
torchfile==0.1.0
torchvision==0.3.0

我尝试过:

pip install torchvision==0.4.1 --no-dependencies
Collecting torchvision==0.4.1
  ERROR: Could not find a version that satisfies the requirement torchvision==0.4.1 (from versions: 0.1.6, 0.1.7, 0.1.8, 0.1.9, 0.2.0, 0.2.1, 0.2.2, 0.2.2.post2, 0.2.2.post3, 0.3.0)
ERROR: No matching distribution found for torchvision==0.4.1

如何安装Torchvision的旧版本?

1 个答案:

答案 0 :(得分:1)

似乎pip install torchvision==0.2.0 --no-deps --no-cache-dir有所帮助。