Ubuntu16.04配置deeplabv3+的pytorch版本

deeplabv3+的github代码:https://github.com/VainF/DeepLabV3Plus-Pytorch
1.我的环境配置
conda安装cud11.0+高版本8.0的cudnn

scipy==1.7.1
numpy==1.21.2
matplotlib==3.4.3
opencv-python==4.5.3.56
torch==1.7.1
torchvision==0.8.2
tqdm==4.62.2
Pillow==8.2.0
h5py==2.10.0
visdom

2.预训练权重下载
腾讯微云:https://share.weiyun.com/qqx78Pv5
讲文件放在新建的文件夹checkpoints下
3.预测图片
首先进入新建的环境

conda activate py1.7

预测结果保存在新建文件夹test_results下
单张图片预测

python predict.py --input 1.png  --dataset voc --model deeplabv3plus_mobilenet --ckpt checkpoints/best_deeplabv3plus_mobilenet_voc_os16.pth --save_val_results_to test_results

python predict.py
–input samples/1_image.png #输入图片
–dataset voc #训练数据集,街道cityscapes, 一般图片voc
–model deeplabv3plus_mobilenet #选择网络模型
–ckpt checkpoints/best_deeplabv3plus_mobilenet_voc_os16.pth #选择预训练参数
–save_val_results_to test_results #输出路径
在这里插入图片描述

在这里插入图片描述

文件夹下所有图片预测

python predict.py --input samples  --dataset voc --model deeplabv3plus_mobilenet --ckpt checkpoints/best_deeplabv3plus_mobilenet_voc_os16.pth --save_val_results_to test_results

在这里插入图片描述
训练:

visdom可视化

#install visdom
pip install visdom
 
anaconda3/envs/deeplabv3/lib/python3.8/site-packages/visdom
注释掉server.py文件中函数download_scripts_and_run()中的一句
#download_scripts()
# Run visdom server
python -m visdom.server
 visdom -port 28333
python main.py --model deeplabv3plus_mobilenet --enable_vis --vis_port 28333 --gpu_id 0 --year 2007 --crop_val --lr 0.01 --crop_size 513 --batch_size 16 --output_stride 16

在这里插入图片描述GPU是3060系列的16G

参考:https://blog.csdn.net/weixin_46118817/article/details/125121751
https://blog.csdn.net/HUASHUDEYANJING/article/details/123959970

labelme制作自己的VOC数据集参考链接:

https://blog.csdn.net/sazass/article/details/127262441
https://blog.csdn.net/qq_36766560/article/details/110009622
https://blog.csdn.net/qq_39056987/article/details/106455828

  • 0
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值