New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How can we save model so for multiple predictions #54
Comments
checker = dde.callbacks.ModelCheckpoint(
"model/model.ckpt", save_better_only=True, period=1000
)
model.train(epochs=epochs, callbacks=[checker])
model.restore("model/model.ckpt-?", verbose=1) # Replace ? with the exact filename
|
Thanks for your detailed answer. I can save the model now |
Hi, what about inverse problems with trainable variables? When I restore a checkpoint a "Key Variable/Adam not found in checkpoint" error is thrown. Any tip? |
You can open a new issue with more details. |
Hi Dr.Lu:
Normally, it should be loaded by model.restore(). But it not work. The problem is '' model2.ckpt-xxx is not in all_model_checkpoint_paths. Manually adding it. '' Continue to run the code:
The text of the error message is soooooo long.
Help me plz, how to solve it. |
You used Windows. Could you try Linux? |
It seems to be the same. My device is Ubuntu 19.10 (GNU/Linux 5.3.0-64-generic x86_64) . Also I use the same code, however the result is not good. I put my code and error message:
Continue to run the code:
|
Did you define |
Thx a lot~ If put model2 and model22 in two files, the code is good running. What I thought was to define two models using Ok, I will remember to put two these in different files. |
Hi Lu, just wondering how can we save network structure and weights after lengthy training so that next time we can only use the pretrained model for predictions rather than starting from scratch (first training then predictions)?
The text was updated successfully, but these errors were encountered: