@ImportError: libtorch_cuda_cu.so: cannot open shared object file: No such file or directory

ImportError: libtorch_cuda_cu.so: cannot open shared object file: No such file or directory

安装mmdet出错
以文章 链接: https://github.com/hustvl/TeViT/tree/main 为例
torch1.9.0
torchvision
0.10.0
mmcv==1.4.8
pip install -r requirements.txt

安装torch torchvision时一定要记住时按章cuda10.2,(我报错的原因就是因为装的是cuda11.3)github前面说了,没注意导致后面mmcv和mmdet一直报错
指定mmcv版本安装

pip install mmcv-full==1.4.8 -f https://download.openmmlab.com/mmcv/dist/cu102/torch1.9.0/index.html

指定mmdet版本安装(错误方法,他指定了只能按照文档介绍的方式安装,不能用pip)

pip install mmdet==2.23.0

正确方法:注意一定要按照顺序,先手动安装MMDetection,再回头上一层文件夹,执行下面的命令
在这里插入图片描述

pip install git+https://github.com/youtubevos/cocoapi.git#"egg=pycocotools&subdirectory=PythonAPI

安装之前强制更新了一下conda要不然一直报setuptools那个错误,

conda update --force conda
conda install -c conda-forge cxx-compiler

gcc安装 c-compiler

每个环境得gcc和g++不一样

Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐