Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/340.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 在自定义模型上显示带有KERA的激活地图_Python_Keras_Neural Network_Artificial Intelligence - Fatal编程技术网

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: []