Closed daixiaogang closed 7 years ago
You already define feed_dict but you again define it while calling activation_visualization. Try this solution:
is_success = activation_visualization(graph_or_path=tf.get_default_graph(), value_feed_dict=feed_dict, layers='r')
thanks,I have solved this problem!
Here's the error I'm getting
ValueError: Cannot feed value of shape (1, 224, 224, 3) for Tensor u'Placeholder:0', which has shape '(2, 224, 224, 3)'
Here's the code for reproducing the error:
images = tf.placeholder("float", [2, 224, 224, 3]) batch1 = img1.reshape((1, 224, 224, 3)) batch2 = img2.reshape((1, 224, 224, 3)) batch = np.concatenate((batch1, batch2), 0) feed_dict = {images: batch} is_success = activation_visualization(graph_or_path=tf.get_default_graph(),value_feed_dict={X:batch},layers='r')
Network is vgg16