I'm trying to print my model.summary() to pdf.
I originally tried following the question asked here: How to save model.summary() to file in Keras?
def myprint(s):
with open('/content/drive/My Drive/xxx/yyy/zzz.pdf','w') as f:
print(s, file=f)
model.summary(print_fn=myprint)
But the file was unreadable.
I asked here, and Bhargav gave me the following solution:
with open('modelsummary.pdf', 'w') as f:
model.summary(print_fn=lambda x: f.write(x + '\n'))
which, when opened with google docs seems fine but when opened/downloaded as a PDF just gives errors, as if the file was corrupted.
Since I have several CNN models to include in my document I need them to automatically be in the style and format that I want them in.
Getting a LaTeX-friendly table would also be ok, but I need someone to give me a MWE because I don't know how to do that.