How to initialise only optimizer variables in Tensorflow?

前端 未结 6 880
别跟我提以往
别跟我提以往 2020-12-13 04:27

I want to use MomentumOptimizer in Tensorflow. However, since this optimizer uses some internal variable, attempting to use it without initializing this variabl

6条回答
  •  粉色の甜心
    2020-12-13 05:06

    There is a more straightforward way:

    optimizer = tf.train.AdamOptimizer()
    session.run(tf.variables_initializer(optimizer.variables()))
    

提交回复
热议问题