环境Ubuntu 25.04,RTX4090,CUDA12.8下的Mr.DETR、Detectron2、detrex、Transformer安装

1、安装环境

Ubuntu:25.04

GPU:RTX 4090

gcc:14

CUDA:12.8

torch:2.4

python安装

复制代码
conda create -n Mr.DETR python=3.8 -y
conda activate Mr.DETR

安装pytorch

复制代码
pip install torch==2.4.0 torchvision==0.19.0 torchaudio==2.4.0 --index-url https://download.pytorch.org/whl/cu124

2、安装Mr.DETR和detectron2

复制代码
git clone https://github.com/Visual-AI/Mr.DETR.git # 下载的文件中detectron2是空的
git submodule init 
git submodule update # 对空的detectron2进行更新
pip install -e detectron2

会报错

参考链接"error: exception specification is incompatible" for cospi/sinpi/cospif/sinpif with glibc-2.41需要cuda中路径为

复制代码
/usr/local/cuda-12.8/include/crt/math_functions.h

文件进行修改,具体将其中的2556、2579、2601以及2623等四处行由下一图修改为下二图,在其后添加noexcept(true)

detectron2即安装完成

3、安装requirements.txt

复制代码
pip install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple/

4、安装detrex

复制代码
pip install -e .

报以下错误

安装pip23.1

复制代码
pip install pip==23.1

继续安装

复制代码
pip install -e .

安装完成

相关推荐
XIAOHEZIcode15 小时前
Ubuntu 终端美化全栈指南:Bash 到 Kitty 踩坑实录
linux·ubuntu·命令行
张飞飞飞飞飞13 天前
Tmux命令使用教程
linux·服务器·ubuntu
世优科技虚拟人14 天前
VR大空间成文旅研学新宠:山海经、西游记、吴哥窟三大IP项目实探
vr·mr·虚拟体验·vr大空间
ujainu小14 天前
CANN ops-transformer:编译和运行 FlashAttention 示例
人工智能·深度学习·transformer
盼小辉丶14 天前
Ubuntu极速部署OpenClaw完全指南(本地模型+DeepSeek)
linux·ubuntu·openclaw
黑白园14 天前
【环境搭建】Ubuntu安装(一)
linux·ubuntu
Moshow郑锴14 天前
Ubuntu用SDKMAN轻松管理多个Java 版本
java·ubuntu·sdkman
error:(14 天前
Ubuntu 22.04 GNOME远程桌面配置问题排查与解决全流程
linux·运维·ubuntu
Java知识技术分享14 天前
在windows上使用wsl安装Ubuntu~linux系统
linux·人工智能·windows·ubuntu