Closed alexTse824 closed 3 years ago
What is the output of model.summary() after model.compile()?
What is the output of model.summary() after model.compile()?
Hello @alexTse824 . Thank you for your comment. Unfortunately, I could not reproduce your error. However, I updated this repository to TensorFlow 2.3.1. All keras have been changed to tf.keras. Please try to use this.
Hello @alexTse824 . Thank you for your comment. Unfortunately, I could not reproduce your error. However, I updated this repository to TensorFlow 2.3.1. All keras have been changed to tf.keras. Please try to use this.
Thanks for the update! I really appreciate that.
Hello I am training VGG16 on my own dataset with TF2.2. The Score-CAM part seemed fine. But when i working on the Guided Score-CAM part, it raise the error 'Tensor is not an element of this graph.' Here's the code:
`
layer_name = 'block5_conv3'
img_path = '1.jpg'
img_array = read_and_preprocess_img(img_path, size=(224,224))
model = load_model('my_model.h5')
guided_model = build_guided_model(model)
tf.compat.v1.disable_eager_execution()
saliency = GuidedBackPropagation(guided_model, img_array, layer_name)
`
Error screenshot:
This is my model: `conv_base = VGG16(include_top=False, weights='imagenet',input_shape=(224, 224, 3))
top_layer = Flatten()(conv_base.output)
top_layer = Dense(256, activation='relu')(top_layer)
top_layer = Dense(3, activation='softmax')(top_layer)
model = Model(inputs=conv_base.input, outputs=top_layer)
model.compile(optimizer=SGD(lr=1e-4), loss='categorical_crossentropy', metrics=['accuracy'])`
Any help would be appreciated, thanks!