Closed QWERDF007 closed 4 years ago
Maybe check whether you have loaded an image successfully.
读取成功了,不然在这之前的 image.shape 会报 None type no attribute shape,可能你的图像都是高分辨率的,当 crop_size 里的元素都大于或者等于 min(h,w) 返回的是False,所以索引得到的列表是空的,因此 random.choice 会抛出异常,改成 crop_size <= min(h,w) 解决
对于图像尺寸为320的,会在hldataset.py 里的 Class RandomCrop
crop_size[crop_size < min(h, w)]
得到一个空的list,接着random.choice(crop_size)
会抛出异常