Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'Node' object has no attribute 'output_masks' #18

Open
Matty0512 opened this issue Apr 16, 2018 · 2 comments
Open

'Node' object has no attribute 'output_masks' #18

Matty0512 opened this issue Apr 16, 2018 · 2 comments

Comments

@Matty0512
Copy link

I've tried loading my own model (A fine tuned version of VGG16) using load_model but I get this error:
`AttributeError Traceback (most recent call last)
in ()
146
147 predicted_class = np.argmax(predictions)
--> 148 cam, heatmap = grad_cam(model, preprocessed_input, predicted_class, "block5_conv3")
149 cv2.imwrite("gradcam.jpg", cam)
150

in grad_cam(input_model, image, category_index, layer_name)
102
103 x = input_model.layers[-1].output
--> 104 x = Lambda(target_layer, output_shape=target_category_loss_output_shape)(x)
105 model = keras.models.Model(input_model.layers[0].input, x)
106

/usr/local/lib/python3.6/dist-packages/keras/engine/topology.py in call(self, inputs, **kwargs)
604
605 # Handle mask propagation.
--> 606 previous_mask = _collect_previous_mask(inputs)
607 user_kwargs = copy.copy(kwargs)
608 if not _is_all_none(previous_mask):

/usr/local/lib/python3.6/dist-packages/keras/engine/topology.py in _collect_previous_mask(input_tensors)
2832 inbound_layer, node_index, tensor_index = x._keras_history
2833 node = inbound_layer._inbound_nodes[node_index]
-> 2834 mask = node.output_masks[tensor_index]
2835 masks.append(mask)
2836 else:

AttributeError: 'Node' object has no attribute 'output_masks'`

@stabgan
Copy link

stabgan commented Jul 24, 2018

I am also having a problem in this error . You found any solution ?

@kuabhish
Copy link

Me too ..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants