New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
训练集图像尺寸差异过大应该如何配置? #3083
Comments
我在训练过程中使用的yml文件信息如下: DataLoader:
Train:
dataset:
name: ImageNetDataset
image_root: /
cls_label_path: /mnt/cls_train/train_new.txt
transform_ops:
- DecodeImage:
to_rgb: True
channel_first: False
- ResizeImage:
resize_short: 48
- RandFlipImage:
flip_code: 1
- TimmAutoAugment:
prob: 1.0
config_str: rand-m9-mstd0.5-inc1
interpolation: bicubic
img_size: [320, 48]
- NormalizeImage:
scale: 1.0/255.0
mean: [0.485, 0.456, 0.406]
std: [0.229, 0.224, 0.225]
order: ''
- RandomErasing:
EPSILON: 1.0
sl: 0.02
sh: 1.0/3.0
r1: 0.3
attempt: 10
use_log_aspect: True
mode: pixel
sampler:
name: DistributedBatchSampler
batch_size: 512
drop_last: False
shuffle: True
loader:
num_workers: 8
use_shared_memory: True 但是有错误提示
应该是图片虽然被按照 resize_short 进行了缩放,但是没有填充,导致输入图像的宽度不在相同尺寸导致的吧? |
那crop加上在看下呢,能提供一下训练的哪个模型吗 |
在训练文种分类模型,crop是指的添加CropImage中的size么。 |
建议参考这个配置文件修改一下配置试试哈
|
好的,我测试一下,感觉这个模型很难训练,尤其是长宽比出现了很大的变化。 |
这个文件是否已经被弃用了呢? 我的配置文件如下: DataLoader:
Train:
dataset:
name: ImageNetDataset
image_root: /
cls_label_path: /mnt/cls_train/train.txt
transform_ops:
- DecodeImage:
to_rgb: True
channel_first: False
- CropWithPadding:
prob: 0.2
padding_num: 0
size: [112, 112]
scale: [0.2, 1.0]
ratio: [0.75, 1.3333333333333333]
- RandFlipImage:
flip_code: 1
- TimmAutoAugment:
prob: 1.0
config_str: rand-m9-mstd0.5-inc1
interpolation: bicubic
img_size: [320, 48]
- NormalizeImage:
scale: 1.0/255.0
mean: [0.485, 0.456, 0.406]
std: [0.229, 0.224, 0.225]
order: ''
- RandomErasing:
EPSILON: 1.0
sl: 0.02
sh: 1.0/3.0
r1: 0.3
attempt: 10
use_log_aspect: True
mode: pixel
sampler:
name: DistributedBatchSampler
batch_size: 512
drop_last: False
shuffle: True
loader:
num_workers: 8
use_shared_memory: True 错误信息:with msg: 'CropWithPadding' object has no attribute '_get_param',另外我发现这个文件中使用的是 错误原因:_get_param 被引用了,但是没有声明,这里应该是一个bug。 |
把完整的配置提供一下吧,我们帮你复现下问题 |
我使用的是PULC language的默认参数,仅仅修改了 DataLoader:
- CropWithPadding:
prob: 0.2
padding_num: 0
size: [112, 112]
scale: [0.2, 1.0]
ratio: [0.75, 1.3333333333333333] 其他都没有改动。问题出现在_get_param(),可以发现在 |
好的,我们已经记录,后续会进行测试 |
请问下,分类数据集图像尺寸差异过大,应该如何设置 ResizeImage 的相关配置。
我希望将图像的短边resize到统一尺寸,长边按照短边进行缩放。
目前看到这个回答。
当我设置
提示
raise ValueError('all input arrays must have the same shape') ValueError: all input arrays must have the same shape
The text was updated successfully, but these errors were encountered: