记录一下trackformer的安装过程

📅 2026/7/26 17:38:02
记录一下trackformer的安装过程
项目地址1、创建python环境并激活conda create-n trackformer python3.8-y conda activate trackformer2、进入trackformer中并且运行setup.pycd trackformer/python setup.py install3、下载pytorch# cuda 11.8pip install torch2.0.1torchvision0.15.2torchaudio2.0.2--index-url https://download.pytorch.org/whl/cu118# 或者使用pip install torch2.0.1torchvision0.15.2torchaudio2.0.2-i https://mirrors.aliyun.com/pypi/simple/4、安装 requirements.txtpip install -r requirements.txt pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple 也可以使用阿里源 -i https://mirrors.aliyun.com/pypi/simple/5、缺什么库 就装什么库pip install pycocotools-i https://mirrors.aliyun.com/pypi/simple/pip install sacred0.8.4-i https://mirrors.aliyun.com/pypi/simple/pip install pyyaml-i https://mirrors.aliyun.com/pypi/simple/pip install motmetrics-i https://mirrors.aliyun.com/pypi/simple/6、安装MultiScaleDeformableAttention最后直接运行的时候提示MultiScaleDeformableAttention因此需要安装MultiScaleDeformableAttentionpython src/trackformer/models/ops/setup.py build--build-basesrc/trackformer/models/ops/install然而有的时候会报错报错内容如下图所是从中可以看出报错的愿意是cuda和gcc的版本不兼容。可以看出gcc的版本不应该超过10.参考cuda error gcc(unsupported GNU version! gcc versions later than 5 are not supported)输出gcc的版本gcc-v安装gcc10sudo apt-get install gcc-10sudo apt-get install g-10将gcc10与cuda建立软连接sudo ln-s/usr/bin/gcc-10/usr/local/cuda/bin/gcc sudo ln-s/usr/bin/g10/usr/local/cuda/bin/g安装MultiScaleDeformableAttentionpython src/trackformer/models/ops/setup.py build --build-basesrc/trackformer/models/ops/ install7 make picturesudo apt install ffmpeg ffmpeg-i data/snakeboard/snakeboard.mp4-vf fps30data/snakeboard/%06d.png8、开始检测python src/track.pywithdataset_nameDEMO data_root_dirdata/snakeboard output_dirdata/snakeboard write_imagesprettypython解决报错ImportError: Bad git executable. https://blog.csdn.net/zzpl139/article/details/128228698