matterport / Mask_RCNN

Mask R-CNN for object detection and instance segmentation on Keras and TensorFlow
Other
24.57k stars 11.69k forks source link

Cannot open the "mask_rcnn-2.1-py3.6.egg" folder on Windows 8.1 #1856

Open jawatroxion opened 4 years ago

jawatroxion commented 4 years ago

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.

cam-garrison commented 4 years ago

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 ?

cam-garrison commented 4 years ago

@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.

jawatroxion commented 4 years ago

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 :)

rsalunga29 commented 4 years ago

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

juskuz commented 4 years ago

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)

Purvapatil2001 commented 2 years ago

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 :)

what changes you have made in that particular line??

Sanjanadhingraa commented 1 year ago

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)

How did you manage to convert the zipped folder back to egg file

lbleal1 commented 1 year ago

I got this problem as well and I found out that the main problem is that the runs do not use the local version of Mask R-CNN and uses the one in the .egg file.

My solution is to point the runs to the local library version. For example, in balloon.py, the following line sys.path.append(ROOT_DIR) # To find local version of the library

didn't work for me and it's still using the version from .egg. So any changes I made on my local parallel_model.py doesn't take effect.

you should change it to: sys.path.insert(1, ROOT_DIR)

so it will use the local version instead of the one in .egg

Coline1 commented 6 months ago

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)

This worked for me, thanks a lot.