Python 在自定义模型上显示带有KERA的激活地图
这是我想显示激活图的模型。我自己的模型:Python 在自定义模型上显示带有KERA的激活地图,python,keras,neural-network,artificial-intelligence,Python,Keras,Neural Network,Artificial Intelligence,这是我想显示激活图的模型。我自己的模型: base\u model=keras.applications.exception(weights='imagenet', 输入形状=尺寸, include_top=False) base_model.trainable=真 输入=keras.输入(形状=尺寸) x=基本模型(输入) x=keras.layers.GlobalAveragePoolig2D()(x) 输出=keras.layers.density(len(class),activatio
base\u model=keras.applications.exception(weights='imagenet',
输入形状=尺寸,
include_top=False)
base_model.trainable=真
输入=keras.输入(形状=尺寸)
x=基本模型(输入)
x=keras.layers.GlobalAveragePoolig2D()(x)
输出=keras.layers.density(len(class),activation='sigmoid')(x)
模型=keras.model(输入、输出)
这是我正在学习的教程
最后,我有colab和工作代码(你必须上传你自己的图片)
但是,当我尝试使用自己的模型显示激活映射时,我得到以下错误:
Graph disconnected: cannot obtain value for tensor KerasTensor(type_spec=TensorSpec(shape=(None, 320, 320, 3),
dtype=tf.float32, name='input_1'), name='input_1', description="created by layer 'input_1'") at layer "block1_conv1".
The following previous layers were accessed without issue: []