PaddleSeg icon indicating copy to clipboard operation
PaddleSeg copied to clipboard

TypeError: __init__() got an unexpected keyword argument 'to_static_training'

Open monkeycc opened this issue 1 year ago • 5 comments

问题确认 Search before asking

Bug描述 Describe the Bug

batch_size: 4
iters: 1000

train_dataset:
  type: Dataset
  dataset_root: E:\out_FEG
  train_path: E:\out_FEG\train.txt
  num_classes: 2
  mode: train
  transforms:
    - type: ResizeStepScaling
      min_scale_factor: 0.5
      max_scale_factor: 2.0
      scale_step_size: 0.25
    - type: RandomPaddingCrop
      crop_size: [512, 512]
    - type: RandomHorizontalFlip
    - type: RandomDistort
      brightness_range: 0.5
      contrast_range: 0.5
      saturation_range: 0.5
    - type: Normalize

val_dataset:
  type: Dataset
  dataset_root: E:\out_FEG
  val_path: E:\out_FEG\val.txt
  num_classes: 2
  mode: val
  transforms:
    - type: Normalize

optimizer:
  type: SGD
  momentum: 0.9
  weight_decay: 4.0e-5

lr_scheduler:
  type: PolynomialDecay
  learning_rate: 0.01
  end_lr: 0
  power: 0.9

loss:
  types:
    - type: CrossEntropyLoss
  coef: [1, 1, 1]


model:
  type: PPLiteSeg
  backbone:
    type: STDC2
    pretrained: https://bj.bcebos.com/paddleseg/dygraph/PP_STDCNet2.tar.gz

python tools/train.py --config configs\quick_start\pp_liteseg_optic_disc_512x512_1k.yml --save_dir output/pp_liteseg_optic_disc_512x512_1k --save_interval 1000 --num_workers 3 --do_eval --use_vdl

Traceback (most recent call last):
  File "tools/train.py", line 213, in <module>
    main(args)
  File "tools/train.py", line 145, in main
    cfg = Config(
TypeError: __init__() got an unexpected keyword argument 'to_static_training'

复现环境 Environment

win11 anaconda python 3.8

paddledet 0.0.0 paddlepaddle-gpu 2.5.2 paddleseg 2.8.0

Bug描述确认 Bug description confirmation

  • [X] 我确认已经提供了Bug复现步骤、代码改动说明、以及环境信息,确认问题是可以复现的。I confirm that the bug replication steps, code change instructions, and environment information have been provided, and the problem can be reproduced.

是否愿意提交PR? Are you willing to submit a PR?

  • [ ] 我愿意提交PR!I'd like to help by submitting a PR!

monkeycc avatar Dec 19 '23 09:12 monkeycc

我也遇到这个问题了,2.9、2.8.1和develop版本都会报这个错误

xqxq-2020 avatar Dec 20 '23 02:12 xqxq-2020

我也遇到这个问题了,windows+GPU环境,2.9版本,直接跑官方例程训练报这个错

Baymax0525 avatar Dec 26 '23 08:12 Baymax0525

The commit version about 3 weeks age is ok! Or you can comment the related codes about static_trainint.

changwsh12 avatar Jan 08 '24 13:01 changwsh12

你好,请尝试在release/2.9或者最新develop分支下:pip install -e . 安装最新paddleseg2.9.0,我们尝试上述指令可以正常训练。 image

shiyutang avatar Jan 19 '24 07:01 shiyutang

我已经解决并发布博客,具体见https://blog.csdn.net/kjjkkjh/article/details/138969354

tfy02 avatar May 16 '24 09:05 tfy02