matroid / dlwithtf

TensorFlow for Deep Learning Book
http://shop.oreilly.com/product/0636920065869.do
322 stars 159 forks source link

Enhancement for Google Colab #18

Open atotev opened 6 years ago

atotev commented 6 years ago

Hi,

I am new to Deep Learning, TF, and tools. I am trying out the examples using Google Colab. One thing I am noticing with the Ch. 3 examples is that I am getting a "placeholder not set" kind of error after I have run the notebook once:

InvalidArgumentError: You must feed a value for placeholder tensor

One workaround is to select Runtime > Restart Runtime... from the menu which is a bit cumbersome and time consuming if you want to experiment with the example and run it many times.

A better approach would be to call tf.reset_default_graph() in the beginning of the program or right before the placeholders are created. I think this would make things easier for people relying on the Google Colab or similar environments.

Thank you, Andrey

atotev commented 6 years ago

Another issue that seems to be in the way of Google Colab is matplotlib being configured to use LaTeX. Removing this initialization piece fixes the issue:

from matplotlib import rc
rc('text', usetex=True)
atotev commented 6 years ago

A great help if you want to install and use deepchem in Google Colab: https://github.com/christianmerkwirth/colabs/blob/master/graph_convolutional_networks_for_tox21_on_colab.ipynb