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有trainid
和color
两种label,代码需要读入的是trainid
,因此还是修改问题2的部分,如下: