Hello
While running the following line of code,
heatmapList, index, label = gen_heatmap("./images/golden_retriever.jpeg", 20, 10, False)
I get an error stating the following :
1 # run the program on image of a golden retriever
----> 2 heatmapList, index, label = gen_heatmap("./images/golden_retriever.jpeg", 20, 10, False)
3 processed = post_process(heatmapList)
in gen_heatmap(fileloc, boxsize, step, verbose, savetodisk)
14 x = reformat([img])
15 x = preprocess_input(x)
---> 16 preds = model.predict(x)
17 correct_class_index = np.argmax(preds[0])
18
~/anaconda3/lib/python3.6/site-packages/keras/engine/training.py in predict(self, x, batch_size, verbose, steps)
1822 x = _standardize_input_data(x, self._feed_input_names,
1823 self._feed_input_shapes,
-> 1824 check_batch_axis=False)
1825 if self.stateful:
1826 if x[0].shape[0] > batch_size and x[0].shape[0] % batch_size != 0:
~/anaconda3/lib/python3.6/site-packages/keras/engine/training.py in _standardize_input_data(data, names, shapes, check_batch_axis, exception_prefix)
121 ': expected ' + names[i] + ' to have shape ' +
122 str(shape) + ' but got array with shape ' +
--> 123 str(data_shape))
124 return data
125
ValueError: Error when checking : expected input_2 to have shape (224, 224, 3) but got array with shape (3, 224, 224)
I am not able to figure out the cause of the error, please help
Thanks