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

Issue while trying to train model #9

Open
SamvdVoort opened this issue Dec 27, 2020 · 1 comment
Open

Issue while trying to train model #9

SamvdVoort opened this issue Dec 27, 2020 · 1 comment

Comments

@SamvdVoort
Copy link

SamvdVoort commented Dec 27, 2020

So I have followed the Medium article and am trying to train the model on a custom dataset of floorplans. After working around some issues I found I am finally ready to train.

However, now I run into a new problem which I can not seem to fix myself. When trying to train on a custom dataset, I get the following error:

Traceback (most recent call last): File "custom.py", line 391, in <module> train(model) File "custom.py", line 222, in train layers='heads') File "C:\...\Custom_MaskRCNN-master\mrcnn\model.py", line 2356, in train self.compile(learning_rate, self.config.LEARNING_MOMENTUM) File "C:\...\Custom_MaskRCNN-master\mrcnn\model.py", line 2201, in compile self.keras_model.add_metric(loss, name) AttributeError: 'Model' object has no attribute 'add_metric'

This comes right after the model should start training, stating that it is starting at epoch 0.
We are kind of at a loss, as we have been struggling to use this model for a couple of hours now.

If anybody knows a solution that would be very much appreciated.

@sadhoss
Copy link

sadhoss commented Jul 13, 2021

For the next person struggling with this.

This thread on Stackoverflow resolved it for me.

TL;DR:

  1. Use tf version 1.3.0, keras version 2.0.8.
  2. Comment out this line, replace with <self.keras_model.metric_tensors.append(loss)>. This makes the code run.

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

2 participants