conda activate mmdet
conda create -n mmdet python=3.8.11
torch离线安装whl网站
https://download.pytorch.org/whl/torch_stable.htmlhttps://download.pytorch.org/whl/torch_stable.html
wget https://download.pytorch.org/whl/cu111/torch-1.8.1%2Bcu111-cp38-cp38-linux_x86_64.whl
wget https://download.pytorch.org/whl/cu111/torchvision-0.9.1%2Bcu111-cp38-cp38-linux_x86_64.whl
在线安装
pip install torch==1.10.1+cu111 torchvision==0.11.2+cu111 torchaudio==0.10.1 -f https://download.pytorch.org/whl/torch_stable.html
安装低版本 出现zipfile错误--查看另一篇博客
pip install torch==1.8.1+cu111 torchvision==0.9.1+cu111 torchaudio==0.8.1 -f https://download.pytorch.org/whl/torch_stable.html
清除pip缓存
cd ~/.cache/pip
sudo rm -rf *
测试 torch v1.10.1
python
import torch
torch.cuda.is_available()
安装mmcv
pip install mmcv-full==1.3.9 -f https://download.openmmlab.com/mmcv/dist/cu111/torch1.8.1/index.html
多卡训练时安装apex
https://github.com/NVIDIA/apexhttps://github.com/NVIDIA/apex
git clone https://github.com/NVIDIA/apex
cd apex
pip install -v --disable-pip-version-check --no-cache-dir ./
下载
git clone https://github.com/open-mmlab/mmdetection.git
服务器没外网,下载ftp上传。
下载不同版本:
Releases · open-mmlab/mmdetection · GitHubhttps://github.com/open-mmlab/mmdetection/releases?page=2
上传解压后,下载对应模型权重。
安装依赖
pip install -r requirements/build.txt
pip install -v -e . 或者[ python setup.py develop]
pip install albumentations -i https://pypi.douban.com/simple/
pip install icecream -i https://pypi.douban.com/simple/
pip install pandas -i https://pypi.douban.com/simple/
pip install tensorboard
pip install dataclasses
准备数据集
scp -P端口号(2024) 用户名@地址:/media/snnu/dataset/1.txt .
准备json标签
准备config配置文件
修改新的类别文件3个
运行
bash ./tools/dist_train.sh ./own/cascade_12th_in24g_1th.py 4
后台运行
nohup bash ./tools/dist_train.sh ./own/cascade_12th_in24g_1th.py 4 >&1.log&
查看日志 tail -f 1.log
查看当前执行程序中某些未退掉的程序
ps -u -a