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

MRCNN-TF2.5 upgrade: Exception has occurred: TypeError unhashable type: 'ListWrapper' when adding loss to keras model #2998

Open
lrpalmer27 opened this issue Nov 2, 2023 · 0 comments

Comments

@lrpalmer27
Copy link

I am updating MRCNN to work on TF2.5 and am running into this issue:

Exception has occurred: TypeError
unhashable type: 'ListWrapper'

coming from: ----------------------------------------------------------

loss_orig = tf.reduce_mean(layer.output, keepdims=True) * self.config.LOSS_WEIGHTS.get(name, 1.) #original
loss = tf.reduce_mean(input_tensor=layer.output, keepdims=True) * self.config.LOSS_WEIGHTS.get(name, 1.) #new

print("ref",self.config.LOSS_WEIGHTS.get(name, 1.))
print("ref",loss_orig)
print("ref",loss)

self.keras_model.add_loss(loss)

This error happens at the start of training a new model, based on coco weights. I've trained this model before, on the same custom dataset using TF2.0.0, but need to upgrade TF versions such that the training can be pushed to the cloud compute service I am using (they don't let you use TF2.0.0).

I am using py3.7.9, and have taken keras out of the model completely.
Up-to-date branch where i am experiencing this issue: https://github.com/lrpalmer27/Mask-RCNN-TF2/tree/python379_implementation

I am unsure why this issue is occurring; has anyone seen this issue before? Thanks in advance for any info/ideas/advice.

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

1 participant