Member-only story

Keras’ ‘lr’ argument is deprecated: What to use instead

Crystal X
2 min readApr 14, 2023

--

I am writing this blog post because the ‘lr’ argument in Keras is deprecated. I discovered this because I have been studying Tensorflow and trying my hand at Kaggle’s Contradictory, My Dear Watson competition question. Even though I was looking at the code for a tutorial for this competition question, it still failed to work and went into error whenever I attempted to train the data. I spent the best part of a day, using up valuable GPU time, troubleshooting this problem on a model written in a Kaggle notebook that was only three years old. Even in as little as three years, the code in Tensorflow had changed so much that it initially caused the model not to train and go into error, and when I did manage to resolve the issue of the non-training, the accuracy was 33% because it only selected the integer of 0 as the label.

I found out that ‘lr’ was deprecated because I was looking at some code in version 2.6 of Tensorflow, and I happened to notice there was a warning message that ‘lr’ had been deprecated and to use ‘learning_rate’ instead. This error message, sadly, did not appear on version 2.11 of Tensorflow, which was the version that I was using, causing me to lose a lot of valuable programming and GPU time.

Below is a screenshot of the code in Keras’s compile function that worked but issued a warning in version 2.6 of…

--

--

Crystal X
Crystal X

Written by Crystal X

I have over five decades experience in the world of work, being in fast food, the military, business, non-profits, and the healthcare sector.

No responses yet