nlintz / TensorFlow-Tutorials

Simple tutorials using Google's TensorFlow Framework
6k stars 1.52k forks source link

visualizing output in autoencoder #53

Closed chahuja closed 7 years ago

hunkim commented 7 years ago

Super!

  1. I really like ipynb, but could you rename it to 06.....ipynb? (Also, could you add ipynb for other files?)
  2. For ipynb, could you add results and simple vis output? From https://github.com/chahuja/TensorFlow-Tutorials/blob/9cf71d045ad06af5166aca0f4e512b4224804346/autoencoder.ipynb, I can only see the in, but no outputs.
chahuja commented 7 years ago

The ipynb version is not ready yet. It needs addition of noise to function as a denoising autoencoder. I could add the notebook version as and when it is ready.

Also, the images are stored as in_vis.png and pred_vis.png and are included as a function in 06_autoencoder.py

hunkim commented 7 years ago

Do you think you can fix this?

Traceback (most recent call last):
  File "06_autoencoder.py", line 81, in <module>
    vis(predicted_imgs,'pred')
  File "06_autoencoder.py", line 15, in vis
    ax = plt.subplot(g)
  File "/home/travis/virtualenv/python2.7.10/lib/python2.7/site-packages/matplotlib/pyplot.py", line 1029, in subplot
    fig = gcf()
  File "/home/travis/virtualenv/python2.7.10/lib/python2.7/site-packages/matplotlib/pyplot.py", line 586, in gcf
    return figure()
  File "/home/travis/virtualenv/python2.7.10/lib/python2.7/site-packages/matplotlib/pyplot.py", line 535, in figure
    **kwargs)
  File "/home/travis/virtualenv/python2.7.10/lib/python2.7/site-packages/matplotlib/backends/backend_tkagg.py", line 84, in new_figure_manager
    return new_figure_manager_given_figure(num, figure)
  File "/home/travis/virtualenv/python2.7.10/lib/python2.7/site-packages/matplotlib/backends/backend_tkagg.py", line 92, in new_figure_manager_given_figure
    window = Tk.Tk()
  File "/opt/python/2.7.10/lib/python2.7/lib-tk/Tkinter.py", line 1814, in __init__
    self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
_tkinter.TclError: no display name and no $DISPLAY environment variable
chahuja commented 7 years ago

Added matplotlib.use('Agg') to bypass using xserver for display

hunkim commented 7 years ago

Cool!