ImportError: .xx/elsa/elsa_ext.cpython-37m-x86_64-linux-gnu.so: undefined symbol: _ZNK2at10TensorBas

具体报错如下:

ImportError:./ELSA/det/mmdet/models/backbones/elsa/elsa_ext.cpython-37m-x86_64-linux-gnu.so: undefined symbol: _ZNK2at10TensorBase8data_ptrIdEEPT_v

方案一
补充安装如下:

pip install torch-cluster
pip install torch-scatter
pip install torch-sparse

方案二
检差cuda的版本和pytorch 的cuda版本是否一致

# 查看cuda的版本
nvcc -V 		
			
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2019 NVIDIA Corporation
Built on Wed_Oct_23_19:24:38_PDT_2019
Cuda compilation tools, release 10.2, V10.2.89
# 查看pytorch 的cuda版本
import torch
torch.version.cuda	

'10.2'

不一致就安装
conda install pytorch==1.8.0 torchvision torchaudio cudatoolkit=10.2 -c pytorch

方案三
重新生成.so文件

cd ./cls/models/elsa
python setup.py install
mv build/lib*/* .
cp *.so ../../../det/mmdet/models/backbones/elsa/
cp *.so ../../../seg/mmseg/models/backbones/elsa/
cd ../../../

应该方案三work

参考链接1
参考链接2
参考链接3

你可能感兴趣的:(Bug,linux,gnu,运维)