infocusp / tf_cnnvis

CNN visualization tool in TensorFlow
MIT License
780 stars 208 forks source link

The output is inconsistent, when output multiple times from the same image processing. #20

Closed Heermosi closed 6 years ago

Heermosi commented 6 years ago

This is observed when I wrote a bug in my code. I happened to output the deconvolution result for the same image multiple times within a loop:

it looks like this:

for i in range(len(testImages)):
      tfcv.deconv_visualization(graph_or_path = tf.get_default_graph(), value_feed_dict = {x : testImages[0:1], y_: testLabels[0:1], keep_prob: 1.0}, input_tensor = xInput, layers = ["r"], path_logdir=logDir + "/Deconvolution/", path_outdir=saveDir + "/Deconvolution/")

I should have corrected the bug. However, when I looked into the results. I found the result is not the same across the repeating times.

This makes me confused. I'm expecting there is a bug in the implementation of tf_cnnvis.

falaktheoptimist commented 6 years ago

Could you please share the TF graph or code? Because there isn't any random component in the deconvolution output generation. Also, we have checked this for a number of runs and across machines and the images match for the cases which we have run. Must be some component specific to your graph.

falaktheoptimist commented 6 years ago

Any updates on this @Heermosi? Does the problem still persist? Or was it resolved?

falaktheoptimist commented 6 years ago

We found one possible loophole which could be causing this and it has been fixed with the latest commit.