UIUNet中数据加载问题,当设置num_work>0时则会报错如下:
Traceback (most recent call last):
RuntimeError: Caught RuntimeError in DataLoader worker process 0.
RuntimeError: result type Double can't be cast to the desired output type Byte
Process finished with exit code 1
在class ToTensorLab(object):中return修改成如下
return {'imidx':torch.from_numpy(imidx).float()
, 'image': torch.from_numpy(tmpImg).float()
, 'label': torch.from_numpy(tmpLbl).float()
}
如果直接设置num_works=0也可以不报错,但是会训练很慢,所以可以通过上述方式来进行修改。