martin-gorner / tensorflow-mnist-tutorial

Sample code for "Tensorflow and deep learning, without a PhD" presentation and code lab.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

_tkinter.TclError: no display name and no $DISPLAY environment variable

diprish opened this issue · comments

I was trying run this on a Ubuntu machine on Google cloud and it got stuck at below issue:

Tensorflow version 1.2.1
Extracting data/train-images-idx3-ubyte.gz
Extracting data/train-labels-idx1-ubyte.gz
Extracting data/t10k-images-idx3-ubyte.gz
Extracting data/t10k-labels-idx1-ubyte.gz
Traceback (most recent call last):
File "mnist_1.0_softmax.py", line 85, in
datavis = tensorflowvisu.MnistDataVis()
File "/home/vcohen/tensorflow-mnist-tutorial/tensorflowvisu.py", line 168, in init
fig = plt.figure(figsize=(19.20,10.80), dpi=dpi)
File "/usr/local/lib/python3.4/dist-packages/matplotlib/pyplot.py", line 535, in figure
**kwargs)
File "/usr/local/lib/python3.4/dist-packages/matplotlib/backends/backend_tkagg.py", line 81, in new_figure_manager
return new_figure_manager_given_figure(num, figure)
File "/usr/local/lib/python3.4/dist-packages/matplotlib/backends/backend_tkagg.py", line 89, in new_figure_manager_given_figure
window = Tk.Tk()
File "/usr/lib/python3.4/tkinter/init.py", line 1854, in init
self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
_tkinter.TclError: no display name and no $DISPLAY environment variable

Yes, this example has a GUI. If you want to use this in command-line mode, just disable the GUI code. There is a comment at the bottom of each sample file that tells you how to do that. You should then also read about Tensorboard and use it for visual output. The goal of this talk/sample is to explain how to interpret test/training loss curves. It works better if you see the curves.