AutoDL运行SCRFD

pycharm-autodl

1.租服务器 3080ti
镜像:PyTorch 1.10.0 Python 3.8(ubuntu20.04) Cuda 11.3

2.jupyterLab激活conda

vim ~/.bashrc

在这里插入图片描述
在最底部添加

source /root/miniconda3/etc/profile.d/conda.sh

重启

bash

激活conda

conda activate base

3.pycharm远程连接autodl
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

登录指令的组成是
ssh -p 端口号 用户名@主机
密码就是复制过来的密码
然后一直点下一步,直到这个界面
在这里插入图片描述
点击同步文件夹,选中你要打开的项目,看好匹配就行
创建即可

剩下的代码可见前一个博客

报错
ImportError: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.29’ not found (required by /root/miniconda3/envs/openmmlab/lib/python3.8/site-packages/matplotlib/_path.cpython-38-x86_64-linux-gnu.so)

strings /usr/lib/x86_64-linux-gnu/libstdc++.so.6 | grep GLIBCXX

看了一眼弹出来的,确实没有

sudo find / -name "libstdc++.so.6*"

在这里插入图片描述
找一个可以用的版本

 strings /root/miniconda3/envs/openmmlab/lib/libstdc++.so.6.0.29 | grep GLIBCXX

开始操作

cp /root/miniconda3/envs/openmmlab/lib/libstdc++.so.6.0.29 /usr/lib/x86_64-linux-gnu/
rm /usr/lib/x86_64-linux-gnu/libstdc++.so.6
ln -s /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.29 /usr/lib/x86_64-linux-gnu/libstdc++.so.6

/usr/lib/x86_64-linux-gnu/libstdc++.so.6

安排完就开始训练

nohup python ./tools/train.py ./configs/scrfd/scrfd_1g.py --gpus=1 2>&1 &
tail -f nohup.out

File “/root/miniconda3/envs/openmmlab/lib/python3.8/site-packages/mmcv/utils/config.py”, line 496, in pretty_text
text, _ = FormatCode(text, style_config=yapf_style, verify=True)
TypeError: FormatCode() got an unexpected keyword argument ‘verify’
直接删就完事了

环境配置

scrfd-github
1.激活环境

conda create --name openmmlab python=3.8 -y
conda activate openmmlab

2.下载torch

pip install torch==1.10.0+cu113 torchvision==0.11.1+cu113 -f https://download.pytorch.org/whl/torch_stable.html

在这里插入图片描述
3.下载mmcv

pip install mmcv-full==1.4.0 -f https://download.openmmlab.com/mmcv/dist/cu113/torch1.10.0/index.html

在这里插入图片描述
4.原文是去pip install -r requirements/build.txt,但是这样安装的是最新版的cython,有点问题,我选择

pip install cython==0.29.28

5.安装mmdet

python setup.py develop

6.安装onnx

pip install onnx
pip install onnx-simplifier

7.一些其他的库

conda install matplotlib
conda install scipy

8.demo运行看看

python demo/image_demo.py weights/face.jpg configs/scrfd/scrfd_500m.py weights/model_500M.pth

效果
在这里插入图片描述
9.onnx导出

python tools/scrfd2onnx.py configs/scrfd/scrfd_34g.py weights/scrfd_34g.pth --shape 640 640 --input-img weights/face.jpg

在这里插入图片描述
显示mmcv版本不对,换成1.3.17

pip install mmcv-full==1.3.17 -f https://download.openmmlab.com/mmcv/dist/cu113/torch1.10.0/index.html

train and test

train

python ./tools/train.py ./configs/scrfd/scrfd_1g.py --gpus=1
nohup python ./tools/train.py ./configs/scrfd/scrfd_1g.py --gpus=1 2>&1 &
tail -f nohup.out

test

GPU=0
GROUP=scrfd
TASK=scrfd_2.5g
CUDA_VISIBLE_DEVICES="$GPU" python -u tools/test_widerface.py ./configs/"$GROUP"/"$TASK".py ./work_dirs/"$TASK"/model.pth --mode 0 --out wouts
  • 7
    点赞
  • 17
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值