Bfgs config error: Key 'max_iters' not in 'OptimizerConf'

Hi, I am using the BFGS optimizer. The following is the config:
defaults :

  • modulus_default
  • scheduler: tf_exponential_lr
  • loss: sum
  • self
  • optimizer: bfgs
    max_iter: 1000

Run the case and get the error:

In ‘config’: ConfigKeyError raised while composing config:
Key ‘max_iter’ not in ‘OptimizerConf’
full_key: optimizer.max_iters

But when I delete max_iter in the config, run the bfgs. In the outputs/casename/.hydra/config.yaml there is a line of “max_iter: 1000”.
Could anyone help me with that? Thanks!

Hi @zhangzhenthu

This is unusual since max_iter is in the hydra config settings.

Its hard to tell what your yaml looks like with the bulleted list. Can you make sure the optimizer is set prior to the “self” in the defaults list? See an example of what should work here:

As you said, I put the self prior to the optimizer in the defaults list. It fixed my problem.

Thank you!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.