CLR icon indicating copy to clipboard operation
CLR copied to clipboard

Optimizer interface changed in more recent TensorFlow versions

Open LucaCappelletti94 opened this issue 1 year ago • 0 comments

In recent tensorflow versions, they changes the lr property to learning_rate.

https://github.com/keras-team/keras/blob/f6c4ac55692c132cd16211f4877fac6dbeead749/keras/src/optimizers/base_optimizer.py#L510-L542

I have gotten it to work with version 2.17 by changing likes such as:

https://github.com/bckenstler/CLR/blob/968cf5a49577f470d55fc17676fcfb6b11447d11/clr_callback.py#L119

to:

self.model.optimizer.learning_rate = self.clr()

I will be making a PR with these changes shortly.

LucaCappelletti94 avatar Sep 28 '24 15:09 LucaCappelletti94