ValueError: The name "reshape" is used 2 times in the model. All operation names should be unique.
使用 heatmap 运行
报错 9
1
ValueError: The name "reshape" is used 2 times in the model. All layer names should be unique.
找到这块代码:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
ifself.heatmap: n_heatmap_filters = self.n_clusters # one heatmap (class activation map) per cluster encoded = self.encoder.output
# heatmap_layer = Reshape((-1, 1, self.n_units[1]))(encoded) # 取个名字即可 heatmap_layer = Reshape((-1, 1, self.n_units[1]), name='1')(encoded) heatmap_layer = UpSampling2D((self.pool_size, 1))(heatmap_layer) heatmap_layer = Conv2DTranspose(n_heatmap_filters, (self.kernel_size, 1), padding='same')(heatmap_layer) # The next one is the heatmap layer we will visualize
heatmap_layer = Reshape((-1, n_heatmap_filters), name='Heatmap')(heatmap_layer) heatmap_output_layer = GlobalAveragePooling1D()(heatmap_layer) # A dense layer must be added only if `n_heatmap_filters` is different from `n_clusters` # heatmap_output_layer = Dense(self.n_clusters, activation='relu')(heatmap_output_layer) heatmap_output_layer = Softmax()(heatmap_output_layer) # normalize activations with softmax
报错 10
1
AttributeError: module'keras.backend'has no attribute 'variable'