Skip to content
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

Saving the model weights in TF 2 #90

Open
danielstafford2001 opened this issue Aug 17, 2020 · 0 comments
Open

Saving the model weights in TF 2 #90

danielstafford2001 opened this issue Aug 17, 2020 · 0 comments

Comments

@danielstafford2001
Copy link

When completing this project using TF2 many functions in base_model can't work due to TF2 not using Sessions. In evaluate.py the function restore_session() is called, what changes should be made to the code to do this in TF2.

I have tried
checkpoint_path = "training_3/cp.ckpt"#defining path where weights will be saved
checkpoint_dir = os.path.dirname(checkpoint_path)

cp_callback = tf.keras.callbacks.ModelCheckpoint(filepath=checkpoint_path,
save_weights_only=True,
verbose=1)#defining a function that is called in my model.fit by using: callbacks=[cp_callback])

I can then call load_weights but I am struggling with doing this within the main() in evaluate.py
Any help with this issue would be great, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant