Install docker for your platform
docker run -it tensorflow/tensorflow
docker run -it tensorflow/tensorflow bash
docker run -v '//local/dir://mapped/dir' -it tensorflow/tensorflow bash
python-tk
Lots of the examples in the crash course depend on python-tk
which is not on the docker image
apt-get update &&\
apt-get install tk-dev python-tk &&\
rm -r /var/lib/apt/lists/*
Matplotlib has facility to print to PDF
import matplotlib
matplotlib.use('Agg') # dont use windows
from matplotlib.backends.backend_pdf import PdfPages
def multi_page(filename, figs=None, dpi=200):
pp = PdfPages(filename)
if figs is None:
figs = [plt.figure(n) for n in plt.get_fignums()]
for fig in figs:
fig.savefig(pp, format='pdf', bbox_inches='tight', fig_size=(10, 8))
pp.close()
then to use it
from plotting_pdf import multi_page
...
multi_page("/tf/report.pdf") # save to mapped folder