2024-06-08 18:26:43 发布
网友
[无法访问pytorch数据加载器值以供使用 TypeError:default_collate:批处理必须包含张量、numpy数组、数字、dict或列表;已找到对象
在kaggle上运行https://jovian.ml/pravin-bnmit/cxr/可以重现错误
为什么不在getitem()方法中进行转换之前尝试一下img = img.resize((1024, 1024))
img = img.resize((1024, 1024))
def __getitem__(self, idx): row = self.df.loc[idx] img_id, img_label = row['Image Index'], row['disease_vec'] img_fname = row['path'] img = Image.open(img_fname) img = img.resize((1024, 1024)) if self.transform: img = self.transform(img) return img, img_label
为什么不在getitem()方法中进行转换之前尝试一下
img = img.resize((1024, 1024))
相关问题 更多 >
编程相关推荐