Use different optimizers depending on a if statement in TENSORFLOW
问题 I'm currently trying to implement a neural network with two training steps. First i want to reduce the loss_first_part function and then i want to reduce the loss_second_part. tf.global_variable_initializer().run() for epoch in range(nb_epochs) if epoch < 10 : train_step = optimizer.minimize(loss_first_part) else : train_step = optimizer.minimize(loss_second_part) The problem is that the initializer should be defined after the optimizer.minimize call . Indeed i've the following error