Skip to content

Instantly share code, notes, and snippets.

@glhfgg1024
Created January 26, 2018 07:33
Show Gist options
  • Save glhfgg1024/653a5d803d5ec782d8e5e1e00d8b7e61 to your computer and use it in GitHub Desktop.
Save glhfgg1024/653a5d803d5ec782d8e5e1e00d8b7e61 to your computer and use it in GitHub Desktop.
don't use same names in tensorflow
The following two pieces of code are not the same. The second one is correct.
image_node = tf.placeholder(tf.float32, shape=[None, DEPTH, HEIGHT, WIDTH, 2])
image_node = tf.map_fn(lambda frame: frame - tf.reduce_mean(frame, axis=[0,1,2], keep_dims=True), image_node)
image_node = tf.placeholder(tf.float32, shape=[None, DEPTH, HEIGHT, WIDTH, 2])
image_node_new = tf.map_fn(lambda frame: frame - tf.reduce_mean(frame, axis=[0,1,2], keep_dims=True), image_node)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment