More Linux struggles to document. And more to come since I’ve been spending a lot of time with Tensorflow lately.
I’ve been training some CNNs lately that requires matplotlib()
graphics to render. The problem is I can’t get X11 Quartz to show up when I run python scripty.py
and want to visualize training at each epoch.
I kept getting this error about incorrect display end points.
File "/usr/lib/python3.5/tkinter/__init__.py", line 1871, in __init__
self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
_tkinter.TclError: couldn't connect to display ":0.0"
I tried just changing the backend. Turns out there are a lot of interesting matplotlib backend options that will alter where and when you view output of matplotlib graphics.
matplotlib.use('GTK')
. Check out the Matplotlib FAQ.
Turns out the solution was as simple as setting secure X11 forwarding during login by adding a -Y
parameter. Voila!
ssh -Y homer@simpsons.com
Special thanks to this useful writeup from the Indiana School of Informatics and Computing:
Now back to training!