llSourcell / tensorflow_demo

Tensorflow Demo for my TF in 5 Min Video on Youtube
229 stars 175 forks source link

Future-proofing for Tensorflow 1.0 #11

Open xkortex opened 7 years ago

xkortex commented 7 years ago

First of all, this is a wonderful tutorial, which is exactly why I think it's worth it to update the code to be compatible with the lastest version of TF, 1.0.x.

It's only a few small tweaks, like instead of w_h = tf.histogram_summary("weights", W) you have w_h = tf.summary.histogram('weights', W)

And at the end

init = tf.initialize_all_variables()
merged_summary_op = tf.merge_all_summaries()

becomes

init = tf.global_variables_initializer()
merged_summary = tf.summary.merge_all()

and some others.

Also there are some issues with the input_data.py that I am working on addressing.

If you want, I can do a fork and PR for you, since I already have the updated code.

EDIT: Okay there is some weirdness in the context manager in the session run part of the code. This might take a while to sort out.

EDIT2: Now I'm getting NaNs.

vyomraj commented 7 years ago

In the newer version:-

tf.audio_summary should be renamed to tf.summary.audio tf.contrib.deprecated.histogram_summary should be renamed to tf.summary.histogram tf.contrib.deprecated.scalar_summary should be renamed to tf.summary.scalar tf.histogram_summary should be renamed to tf.summary.histogram tf.image_summary should be renamed to tf.summary.image tf.merge_all_summaries should be renamed to tf.summary.merge_all tf.merge_summary should be renamed to tf.summary.merge tf.scalar_summary should be renamed to tf.summary.scalar tf.train.SummaryWriter should be renamed to tf.summary.FileWriter