Skip to content
Advertisement

Modifying the weights and biases of a restored CNN model in TensorFlow

I have recently started using TensorFlow (TF), and I have come across a problem that I need some help with. Basically, I’ve restored a pre-trained model, and I need to modify the weights and biases of one of its layers before I retest its accuracy. Now, my problem is the following: how can I change the weights and biases using the assign method in TF? Is modifying the weights of a restored modeled even possible in TF?

Here is my code:

JavaScript

Advertisement

Answer

In addition to an existing answer, tensor update can be performed via tf.assign function.

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement