【语义分割】使用DAFormer测试自己的数据集

DAFormer: https://github.com/lhoyer/DAFormer
window运行shell命令: 使用git bash
pip 安装包超时: pip --default-timeout=100 install -i https://pypi.douban.com/simple xxxx

问题:
问题1:ModuleNotFoundError: No module named mcvv.parallel
mcvv-full 版本不匹配,作者提供的环境是linux上的,需要在win上适配的版本

问题2:mmseg - INFO - Loaded 0 images

  • check your path to your images and annotations in your config file
  • check which dataset type you are using, and go to mmseg/datasets/[dataset].py and check the requirement of the corresponding dataset type. You should check the format of image and annotation and its suffix.
    修改图片读取中image和label的文件名后缀:
点击查看代码
def __init__(self,
                 img_suffix='.png',
                 seg_map_suffix='_train_color.png',
                 **kwargs):

问题3:evaluate时File "c:\codeDAFormer-master mmseg coreevaluation metrics.py", line 83, in intersect_and_unionpred Tabe7 = pred Tabe7[mask] IndexError: too many indices for tensor of dimension 2
此时预测输出的结果是正常的,打印发现predicted_label是2维tensor,gt_label是3维的。学姐给提示看‘trainid和颜色的对应关系’,顺藤摸瓜,发现是label读错了。
cityscapes有trainidcolor两种label,代码需要读入的是trainid,因此还是修改问题2的部分,如下:
image

posted @   不要肥宅  阅读(423)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
点击右上角即可分享
微信分享提示