Skip to content

TypeError: unhashable type: 'ListWrapper' #5

@manaswakchaure

Description

@manaswakchaure

Describe the bug
While running training on the COCO data set. I am getting errors as TypeError: unhashable type: 'ListWrapper'.

can you help me with?

Starting at epoch 0. LR=0.001

Checkpoint Path: /home/wakchaure/project/coco_notebook_onion_leat_model/logs/onion_segmentation20221130T1627/mask_rcnn_onion_segmentation_{epoch:04d}.h5
Selecting layers to train
fpn_c5p5 (Conv2D)
fpn_c4p4 (Conv2D)
fpn_c3p3 (Conv2D)
fpn_c2p2 (Conv2D)
fpn_p5 (Conv2D)
fpn_p2 (Conv2D)
fpn_p3 (Conv2D)
fpn_p4 (Conv2D)
In model: rpn_model
rpn_conv_shared (Conv2D)
rpn_class_raw (Conv2D)
rpn_bbox_pred (Conv2D)
mrcnn_mask_conv1 (TimeDistributed)
mrcnn_mask_bn1 (TimeDistributed)
mrcnn_mask_conv2 (TimeDistributed)
mrcnn_mask_bn2 (TimeDistributed)
mrcnn_class_conv1 (TimeDistributed)
mrcnn_class_bn1 (TimeDistributed)
mrcnn_mask_conv3 (TimeDistributed)
mrcnn_mask_bn3 (TimeDistributed)
mrcnn_class_conv2 (TimeDistributed)
mrcnn_class_bn2 (TimeDistributed)
mrcnn_mask_conv4 (TimeDistributed)
mrcnn_mask_bn4 (TimeDistributed)
mrcnn_bbox_fc (TimeDistributed)
mrcnn_mask_deconv (TimeDistributed)
mrcnn_class_logits (TimeDistributed)
mrcnn_mask (TimeDistributed)

TypeError Traceback (most recent call last)
in
6 learning_rate=config.LEARNING_RATE,
7 epochs=5,
----> 8 layers='heads')

~/project/coco_notebook_onion_leat_model/mrcnn/model.py in train(self, train_dataset, val_dataset, learning_rate, epochs, layers, augmentation, custom_callbacks, no_augmentation_sources)
2346 log("Checkpoint Path: {}".format(self.checkpoint_path))
2347 self.set_trainable(layers)
-> 2348 self.compile(learning_rate, self.config.LEARNING_MOMENTUM)
2349
2350 # Work-around for Windows: Keras fails on Windows when using

~/project/coco_notebook_onion_leat_model/mrcnn/model.py in compile(self, learning_rate, momentum)
2169 tf.reduce_mean(input_tensor=layer.output, keepdims=True)
2170 * self.config.LOSS_WEIGHTS.get(name, 1.))
-> 2171 self.keras_model.add_loss(loss)
2172
2173 # Add L2 Regularization

~/anaconda3/envs/python3_6/lib/python3.6/site-packages/tensorflow_core/python/keras/engine/base_layer.py in add_loss(self, losses, inputs)
1130 for symbolic_loss in symbolic_losses:
1131 if getattr(self, '_is_graph_network', False):
-> 1132 self._graph_network_add_loss(symbolic_loss)
1133 else:
1134 # Possible a loss was added in a Layer's build.

~/anaconda3/envs/python3_6/lib/python3.6/site-packages/tensorflow_core/python/keras/engine/network.py in _graph_network_add_loss(self, symbolic_loss)
1431 new_nodes.extend(add_loss_layer.inbound_nodes)
1432 new_layers.append(add_loss_layer)
-> 1433 self._insert_layers(new_layers, new_nodes)
1434
1435 def _graph_network_add_metric(self, value, aggregation, name):

~/anaconda3/envs/python3_6/lib/python3.6/site-packages/tensorflow_core/python/keras/engine/network.py in _insert_layers(self, layers, relevant_nodes)
1390
1391 # Insert layers and update other layer attrs.
-> 1392 layer_set = set(self._layers)
1393 for layer in layers:
1394 if layer not in layer_set:

~/anaconda3/envs/python3_6/lib/python3.6/site-packages/tensorflow_core/python/training/tracking/data_structures.py in hash(self)
545 # List wrappers need to compare like regular lists, and so like regular
546 # lists they don't belong in hash tables.
--> 547 raise TypeError("unhashable type: 'ListWrapper'")
548
549 def insert(self, index, obj):

TypeError: unhashable type: 'ListWrapper'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions