log model architecture

This commit is contained in:
2022-10-12 21:05:33 +00:00
parent e09ba52327
commit fb0fa16ed0
4 changed files with 36 additions and 13 deletions
+14
View File
@@ -220,3 +220,17 @@ def load_model(model, checkpoint, disable_assert=False, assert_consumed_on=False
ckpt.restore(manager.latest_checkpoint).assert_consumed()
else:
ckpt.restore(manager.latest_checkpoint).assert_existing_objects_matched()#.assert_consumed()
def get_summary_str(model):
lines = []
model.summary(print_fn=lines.append, line_length=150,expand_nested=True,show_trainable=True)
# Add initial spaces to avoid markdown formatting in TensorBoard
return lines
def get_summary_html(model):
lines = get_summary_str(model)
html = ''
for line in lines:
html += "<pre>" + line + "</pre>"
return html