YOLOX 训练环境搭建

本人系统内核信息
(base) mr_zhang@mrzhang940328:~/桌面$ uname -a
Linux mrzhang940328 5.11.0-27-generic #29~20.04.1-Ubuntu SMP Wed Aug 11 15:58:17 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

1、创建conda环境
conda create -n Yolox python=3.7
2、激活环境
conda activate Yolox
3、安装代码依赖的库文件
pip3 install -U pip && pip3 install -r requirements.txt
pip3 install -v -e .*(注意点一定不要漏了)*或者用python3 setup.py develop
4、安装pycocotools

pip3 install cython; pip3 install ‘git+https://github.com/cocodataset/cocoapi.git#subdirectory=PythonAPI’

如果报错如下:
Collecting cython
Using cached Cython-0.29.24-cp37-cp37m-manylinux1_x86_64.whl (2.0 MB)
Installing collected packages: cython
Successfully installed cython-0.29.24
Collecting git+https://github.com/cocodataset/cocoapi.git#subdirectory=PythonAPI
Cloning https://github.com/cocodataset/cocoapi.git to /tmp/pip-req-build-wu49q19m
Running command git clone -q https://github.com/cocodataset/cocoapi.git /tmp/pip-req-build-wu49q19m
fatal: unable to access ‘https://github.com/cocodataset/cocoapi.git/’: GnuTLS recv error (-110): The TLS connection was non-properly terminated.
WARNING: Discarding git+https://github.com/cocodataset/cocoapi.git#subdirectory=PythonAPI. Command errored out with exit status 128: git clone -q https://github.com/cocodataset/cocoapi.git /tmp/pip-req-build-wu49q19m Check the logs for full command output.
ERROR: Command errored out with exit status 128: git clone -q https://github.com/cocodataset/cocoapi.git /tmp/pip-req-build-wu49q19m Check the logs for full command output.
(Yolox) mr_zhang@mrzhang940328:~/deepleaning/YOLOX-main$
重新安装命令如下:
pip3 install cython; pip3 install ‘git+git://github.com/cocodataset/cocoapi.git#subdirectory=PythonAPI’

5、运行demo

使用代码中自带的图片,进行Demo测试。
在YOLOX文件夹的终端页面输入:

python3 tools/demo.py image -n yolox-s -c yolox_s.pth --path assets/2.png --conf 0.3 --nms 0.5 --tsize 640 --save_result --device [gpu]

YOLOX的代码中,会新建一个YOLOX_outputs文件夹,在其中的yolox_s/vis_res/,可以看到带有检测效果的图片,到此Yolox的测试环境,以及测试效果都实现了。

  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值