MrGemy95/Tensorflow-Project-Template

Loaded variables reinitialization

marinadec opened this issue · 2 comments

Hello!
I have a little concern about the model.load() position in main().
Suppose we are in main().
First, you load the model (model.load()) and then initialize variables in base train (via "self.sess.run(self.init)" in "trainer = ExampleTrainer(...)").
But in this case all the variables from the loaded model will be reinitialized with default values.
If I'm not mistaken about my concern, the solution is simple - move model.load() right after the trainer = ExampleTrainer(...) in main().
It helped me while implementing your magnificent template for my project.
Thanks.

yata0 commented

I find the same issue。And I agree with you. @marinadec
@MrGemy95

I think you're right, till now i changed it in the main,, but i think it's better to remove the variables initialization part from the trainer. and put it in the main.