infocusp / tf_cnnvis

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

deepdream issue #71

Open ishwara-bhat opened 6 years ago

ishwara-bhat commented 6 years ago

Hi, I got activation_visualization running. But deepdream has error at _write_deepdream(). is_success = activation_visualization(sess_graph_path = self.session, value_feed_dict = {self.input_placeholder : im}, layers=layers, path_logdir=os.path.join("Log","MyModelfromMeta"), path_outdir=os.path.join("Output","MyModelfromMeta"))

But the deepdream_visualization has error. I am using tensorflow 1.10. (I got few deprecation warnings on

is_success = deepdream_visualization(sess_graph_path = self.session, value_feed_dict ={self.input_placeholder:im}, layer="softmax_tensor", classes = ['label1', 'label2', 'label3'], input_tensor=None, path_logdir='./Log', path_outdir='./Output')

script: tf_cnnvis\utils.py line 195. _write_deepdream.

imsave(os.path.join(pathout, "image%d.png" % (units[(i * images[i].shape[0]) + j + k])), img_save, format = "png")

TypeError: %d format: a number is required, not str

Deprecation warnings for utils.py 👎 calling reduce_mean (from tensorflow.python.ops.math_ops) with keep_dims is deprecated and will be removed in a future version. Instructions for updating: keep_dims is deprecated, use keepdims instead Traceback

Thanks in advance, Ishwar

falaktheoptimist commented 6 years ago

Hi! You need to pass in the class numbers as list of integers - so in the above case, the input would be something like classes=[0,1,2]. Doing this should resolve your issue. Also, thank you for bringing this to our notice- we'll update the documentation a bit and also add a check for this in the code. Thanks!