PaddlePaddle / PaddleClas

A treasure chest for visual classification and recognition powered by PaddlePaddle
Apache License 2.0
5.43k stars 1.17k forks source link

配置文件图像宽高问题 #2866

Open abanger opened 1 year ago

abanger commented 1 year ago

问题是在配置配置文件图像宽高调整(image_shape: [3, 350, 550]或image_shape: [3 550, 350,])不影响训练结果为什么?

`# global configs Global: checkpoints: null pretrained_model: null output_dir: ./output/ device: gpu save_interval: 1 eval_during_train: True eval_interval: 1 epochs: 120 print_batch_step: 10 use_visualdl: False

used for static mode and model export

image_shape: [3, 350, 550] save_inference_dir: ./inference

training model under @to_static

to_static: False

model architecture

Arch: name: ResNet50 class_num: 2

data loader for train and eval

DataLoader: Train: dataset: name: ImageNetDataset image_root: /data/bapps/dd/ cls_label_path: /data/bapps/dd/train_list.txt transform_ops:

`

  1. PaddleClas版本以及PaddlePaddle版本:Paddle2.4.2,PaddleClas2.4
  2. 训练环境信息: a. 具体操作系统,Linux b. Python版本号,Python 3.9.16 c. CUDA/cuDNN版本, CUDA10.2/cuDNN 7.6.5等
TingquanGao commented 1 year ago

Global. image_shape字段在训练时无效,只用于在将模型导出为inference model时候(tools/export_model.py)。训练时输入网络的图像尺寸是在DataLoader.Train.transform_ops中的RandCropImage(或使用ResizeImage)来定义的,比如:

https://github.com/PaddlePaddle/PaddleClas/blob/release/2.5/ppcls/configs/ImageNet/MobileNetV3/MobileNetV3_small_x1_0.yaml#L56-L57C22

abanger commented 1 year ago

Global. image_shape字段在训练时无效,只用于在将模型导出为inference model时候(tools/export_model.py)。训练时输入网络的图像尺寸是在DataLoader.Train.transform_ops中的RandCropImage(或使用ResizeImage)来定义的,比如:

https://github.com/PaddlePaddle/PaddleClas/blob/release/2.5/ppcls/configs/ImageNet/MobileNetV3/MobileNetV3_small_x1_0.yaml#L56-L57C22

好像不是您说的这样:使用RandCropImage(或使用ResizeImage), ResizeImage输入只能一个参数:size: xxx。 而且如vgg16等网络,需要改变网络结构参数才能使用。