to_heatmap function error
Model type detected: global pooling Model cut at layer: 1
ValueError Traceback (most recent call last)
/content/heatmaps/heatmap/heatmap.py in to_heatmap(model, input_shape) 238 239 if model_type == "global pooling": --> 240 x = copy_last_layers(model, index + 1, x) 241 242 elif model_type == "local pooling - flatten":
/content/heatmaps/heatmap/heatmap.py in copy_last_layers(model, begin, x, last_activation) 166 last_activation = layer.get_config()["activation"] 167 if i == len(model.layers) - 1: --> 168 x = add_reshaped_layer(layer, x, 1, no_activation=True) 169 else: 170 x = add_reshaped_layer(layer, x, 1)
/content/heatmaps/heatmap/heatmap.py in add_reshaped_layer(layer, x, size, no_activation, atrous_rate) 208 x = new_layer(x) 209 # We transfer the weights: --> 210 insert_weights(layer, new_layer) 211 return x 212
/content/heatmaps/heatmap/heatmap.py in insert_weights(layer, new_layer) 153 W, b = layer.get_weights() 154 ax1, ax2, previous_filter, n_filter = new_layer.get_weights()[0].shape --> 155 new_W = W.reshape((ax1, ax2, previous_filter, n_filter)) 156 new_W = new_W.transpose((0, 1, 2, 3)) 157
ValueError: cannot reshape array of size 4096 into shape (1,1,3,2)
Could you share the code that you used and also format it correctly with markdown? It's going to be easier to read.