項目地址:https://github.com/milesial/Pytorch-UNet
報錯內容:
Either no mask or multiple masks found for the ID{idx}:{mask_file}'
AssertionError:Either no mask or multiple masks found for the ID.
解決方案:
data_loading中的CarvanaDataset類下的改為mask_suffix='', 附上修改后的代碼:
class CarvanaDataset(BasicDataset): def __init__(self, images_dir, masks_dir, scale=1): super().__init__(images_dir, masks_dir, scale, mask_suffix=''
# mask_suffix='_mask'被修改為mask_suffix=''