# TensorFlow.jl, set learning rate as Variable

**URL:** <https://discourse.julialang.org/t/tensorflow-jl-set-learning-rate-as-variable/7848>\
**Category:** Machine Learning\
**Created:** [December 19, 2017, 11:39am UTC](https://discourse.julialang.org/t/tensorflow-jl-set-learning-rate-as-variable/7848 "2017-12-19T11:39:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![davidavdav](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/davidavdav/32/1065_2.png) [@davidavdav](https://discourse.julialang.org/u/davidavdav)\
**Post date:** [December 19, 2017, 11:39am UTC](https://discourse.julialang.org/t/tensorflow-jl-set-learning-rate-as-variable/7848/1 "2017-12-19T11:39:46Z")

</div>

Hello,

I’d like to control the learning rate of the optimizer in TensorFlow, so in different stages of the training (actually fixing different parts of the network) I want to be able to set different learning rates.

From [here](https://github.com/ibab/tensorflow-wavenet/issues/267) I understand that I should make the learning rate a `Variable`, and pass this to the optimizer as argument. However, I get a Julia error  
`ERROR: LoadError: MethodError: Cannot `convert` an object of type TensorFlow.Tensor{Float64} to an object of type Float64`, I think because the variable is always a tensor (even one with shape `[]`), and the wrapper expects a `Float64` in the place of the learning rate parameter.

Any thoughts on this?

—david
