Mask_rcnn: Cannot open the "mask_rcnn-2.1-py3.6.egg" folder on Windows 8.1

Created on 12 Nov 2019  路  5Comments  路  Source: matterport/Mask_RCNN

Good day

I'm trying to train the MRCNN on my Anaconda environment. I'm using Python 3.6 and on a Windows 8.1. I believe I've managed to install TF (version 1.15.0) and KERAS (version 2.2.4-tf) correctly (this is my first time playing around with deep learning btw).

I've managed to get down to the line where the error is happening, and the code is:
model.train(train_set, test_set, learning_rate=config.LEARNING_RATE, epochs=5, layers='heads')

The error that comes out is AttributeError: 'Model' object has no attribute 'metrics_tensors'
(details below):

  File "<ipython-input-238-263ad0415591>", line 1, in <module>
    runfile('D:/alfian/python functions/trainTestMangoes.py', wdir='D:/alfian/python functions')

  File "C:\Users\student\Anaconda3\envs\tfCPU_Alfian\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 827, in runfile
    execfile(filename, namespace)

  File "C:\Users\student\Anaconda3\envs\tfCPU_Alfian\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 110, in execfile
    exec(compile(f.read(), filename, 'exec'), namespace)

  File "D:/alfian/python functions/trainTestMangoes.py", line 164, in <module>
    model.train(train_set, test_set, learning_rate=config.LEARNING_RATE, epochs=5, layers='heads')

  File "C:\Users\student\Anaconda3\envs\tfCPU_Alfian\lib\site-packages\mask_rcnn-2.1-py3.6.egg\mrcnn\model.py", line 2354, in train
    self.compile(learning_rate, self.config.LEARNING_MOMENTUM)

  File "C:\Users\student\Anaconda3\envs\tfCPU_Alfian\lib\site-packages\mask_rcnn-2.1-py3.6.egg\mrcnn\model.py", line 2199, in compile
    self.keras_model.metrics_tensors.append(loss)

AttributeError: 'Model' object has no attribute 'metrics_tensors'

I've seen a solution being suggested here: #145 and tried implement it. The problem is, I can't seem to get into the mask_rcnn-2.1-py3.6.egg folder from Windows Explorer in order to access the model.py file.. When I go to the Anaconda prompt, I see that mask_rcnn-2.1-py3.6.egg is listed, however it does not seem to be a directory/folder (please refer to the screen shot below):
errormasrcnn

I did try to do a search for a model.py file on my computer, and found the one located at C:\Users\student\Mask_RCNN\mrcnn\model.py. Modified it as per #145 suggestion, but the error still persists. I was wondering if anyone can help? Any assistance is much appreciated.

Most helpful comment

I'm having the same issue, I found the .egg file located here, /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/mask_rcnn-2.1-py3.7.egg . I've been trying to modify what's inside the /mrcnnl/model.py which is inside the .egg file : using pkg_resources resource_stream, found in this stackoverflow answer, but this doesn't seem to work as mrcnn is not treated as an installed distribution, so it won't open the package file.

It looks like another user @pipun-gif here is having a similar issue and tried to unzip the file.

Any chance you figured it out @jawatroxion ?

Hi @cam-garrison ...
Good to know that you've gotten it to work.
Actually I was wanting to post an update here, but never got about doing it. Sorry, my bad.

I solved it by firstly uninstalling the Mask RCNN package. Then for the modification... I went to the downloaded installation files... and modified that particular line of code in the model.py file BEFORE installing mask-rcnn. That solved the problem :)

All 5 comments

I'm having the same issue, I found the .egg file located here, /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/mask_rcnn-2.1-py3.7.egg . I've been trying to modify what's inside the /mrcnnl/model.py which is inside the .egg file : using pkg_resources resource_stream, found in this stackoverflow answer, but this doesn't seem to work as mrcnn is not treated as an installed distribution, so it won't open the package file.

It looks like another user @pipun-gif here is having a similar issue and tried to unzip the file.

Any chance you figured it out @jawatroxion ?

@jawatroxion @pipun-gif I just got it to work by using Keras version 2.2.5 and Tensorflow v1.15.0rc2, hopefully that helps if you are still having the same issue still.

I'm having the same issue, I found the .egg file located here, /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/mask_rcnn-2.1-py3.7.egg . I've been trying to modify what's inside the /mrcnnl/model.py which is inside the .egg file : using pkg_resources resource_stream, found in this stackoverflow answer, but this doesn't seem to work as mrcnn is not treated as an installed distribution, so it won't open the package file.

It looks like another user @pipun-gif here is having a similar issue and tried to unzip the file.

Any chance you figured it out @jawatroxion ?

Hi @cam-garrison ...
Good to know that you've gotten it to work.
Actually I was wanting to post an update here, but never got about doing it. Sorry, my bad.

I solved it by firstly uninstalling the Mask RCNN package. Then for the modification... I went to the downloaded installation files... and modified that particular line of code in the model.py file BEFORE installing mask-rcnn. That solved the problem :)

I'm having the same issue, I found the .egg file located here, /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/mask_rcnn-2.1-py3.7.egg . I've been trying to modify what's inside the /mrcnnl/model.py which is inside the .egg file : using pkg_resources resource_stream, found in this stackoverflow answer, but this doesn't seem to work as mrcnn is not treated as an installed distribution, so it won't open the package file.
It looks like another user @pipun-gif here is having a similar issue and tried to unzip the file.
Any chance you figured it out @jawatroxion ?

Hi @cam-garrison ...
Good to know that you've gotten it to work.
Actually I was wanting to post an update here, but never got about doing it. Sorry, my bad.

I solved it by firstly uninstalling the Mask RCNN package. Then for the modification... I went to the downloaded installation files... and modified that particular line of code in the model.py file BEFORE installing mask-rcnn. That solved the problem :)

recommended way to temporarily fix this problem until the Matterport team ships a fix

I had similar problem (Windows10 & WSL (Ubuntu)). I unzipped the egg file with 'unzip' command. Then the mrcnn directory appeared and I could step into it to see the code. And my jupyter notebook started using this directory instead of .egg file. (I've no idea why but it is working)

Was this page helpful?
0 / 5 - 0 ratings