PaddlePaddle / PaddleSeg

Easy-to-use image segmentation library with awesome pre-trained model zoo, supporting wide-range of practical tasks in Semantic Segmentation, Interactive Segmentation, Panoptic Segmentation, Image Matting, 3D Segmentation, etc.
https://arxiv.org/abs/2101.06175
Apache License 2.0
8.56k stars 1.68k forks source link

DataLoader reader thread raised an exception. #885

Closed FeiMa-REC closed 3 years ago

FeiMa-REC commented 3 years ago

报错如下:

图片

文件相关配置:

base.yml】


batch_size: 2 iters: 80000

train_dataset: type: Dataset dataset_root: ./ train_path: train_list.txt num_classes: 15 transforms:

val_dataset: type: Dataset dataset_root: ./ val_path: val_list.txt num_classes: 15 transforms:

optimizer: type: sgd momentum: 0.9 weight_decay: 4.0e-4

learning_rate: value: 0.0075 decay: type: poly power: 0.9 end_lr: 0.0

loss: types:

【train.yml】


base: '../base/SmartCar_base_Config.yml'

batch_size: 2 iters: 80000

model: type: DeepLabV3P backbone: type: ResNet101_vd output_stride: 8 multi_grid: [1, 2, 4] pretrained: https://bj.bcebos.com/paddleseg/dygraph/resnet101_vd_ssld.tar.gz num_classes: 15 backbone_indices: [0, 3] aspp_ratios: [1, 12, 24, 36] aspp_out_channels: 256 align_corners: False pretrained: null

【文件结构】:


图片

图片

【train_list】:


图片

BeyondYourself commented 3 years ago

预训练模型直接用压缩文件?? 都不解压么

FeiMa-REC commented 3 years ago

预训练模型直接用压缩文件?? 都不解压么

执行训练流程的时候会在下载完预训练模型后自动解压吧?我看到有解压步骤的出现的。这个应该是dataloader的问题`(>﹏<)′

michaelowenliu commented 3 years ago

@YuBCS-Ma I guess data_root is wrong.

FeiMa-REC commented 3 years ago

@michaelowenliu I guess data_root is wrong.

My file tree is as follows :

图片

&& My Config root is :

train_dataset: type: Dataset dataset_root: data/ train_path: data/train_list.txt

val_dataset: type: Dataset dataset_root: data/ val_path: data/val_list.txt

My train_list.txt :

图片

But this time it still reported a mistake : <

图片

图片

BeyondYourself commented 3 years ago

image 你在配置文件中添加上transform 设置它的属性Resize试试 @YuBCS-Ma

FeiMa-REC commented 3 years ago

在配置文件中添加上transform 设置它的属性Resize试试 @BeyondYourself

啊,老哥,那个错误我解决了。resize没事,就是一直报数据读取的错。但是我的文件路径都对啊,不知道为什么跑不通。

图片

刚刚跑的。

michaelowenliu commented 3 years ago

@YuBCS-Ma how did you run "train.py"? what is the absolute path of the data directory?

FeiMa-REC commented 3 years ago

@michaelowenliu how did you run "train.py"? what is the absolute path of the data directory?

In this way :

图片

&& The absolute path of the data is : home/aistudio/data/

图片

BeyondYourself commented 3 years ago

我之前遇到过报错和你一模一样的,结果是transform的属性值配置顺序有问题,resize最为最后属性值 @YuBCS-Ma

FeiMa-REC commented 3 years ago

我之前遇到过报错和你一模一样的,结果是transform的属性值配置顺序有问题,resize最为最后属性值 @BeyondYourself

这是我的Transform

图片

BeyondYourself commented 3 years ago

你先试试属性值只加上Resize和Normalize @YuBCS-Ma

FeiMa-REC commented 3 years ago

你先试试属性值只加上Resize和Normalize @BeyondYourself

我试了只加Normalize,还是一样的报错,应该不是这个的问题。

BeyondYourself commented 3 years ago

这种报错有的时候真的不太好找,建议debug看看

michaelowenliu commented 3 years ago

@YuBCS-Ma Hi, please try running train.py in PaddleSeg-Release-v2.0 directory, and set data_root to home/aistudio/data/, set train_path: home/aistudio/data/train_list.txt.

BeyondYourself commented 3 years ago

@michaelowenliu 所以在读取文件是不是应该加一个验证文件以及路径是否存在

michaelowenliu commented 3 years ago

@BeyondYourself Hi, a great idea! Hope you can help to add this feature and submit the PR.

BeyondYourself commented 3 years ago

OK,我试试看

wuyefeilin commented 3 years ago

我之前遇到过报错和你一模一样的,结果是transform的属性值配置顺序有问题,resize最为最后属性值 @BeyondYourself

这是我的Transform

图片

RandomRotation 会改变图片大小,把它放到RandomPaddingCrop之前

BeyondYourself commented 3 years ago

@wuyefeilin 出个transform的配置宝典吧

wuyefeilin commented 3 years ago

@wuyefeilin 出个transform的配置宝典吧

感谢反馈,我们会充分考虑你的建议

FeiMa-REC commented 3 years ago

@michaelowenliu @wuyefeilin

Finally, it works!!!:)

I should set_env PYTHONPATH='/home/aistudio/PaddleSeg-release-v2.0/' and change dataset_root , train_path, also should put the RandomRotation before the RandomPaddingCrop.

Thx! ! !

Exusia-0 commented 3 years ago

我之前遇到过报错和你一模一样的,结果是transform的属性值配置顺序有问题,resize最最后的属性值@BeyondYourself

这是我的Transform 图片

RandomRotation会改变图片大小,把它放到RandomPaddingCrop之前

确实是这个问题