matterport / Mask_RCNN

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

parallel_model.py #1601

Open ganav opened 5 years ago

ganav commented 5 years ago

I am using keras 2.2.4 My error is as below:


Traceback (most recent call last): File "C:\Users\gana\AppData\Local\Programs\Python\Python35\lib\site-packages\keras\engine\network.py", line 307, in setattr is_graph_network = self._is_graph_network File "parallel_model.py", line 45, in getattribute return super(ParallelModel, self).getattribute(attrname) AttributeError: 'ParallelModel' object has no attribute '_is_graph_network'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "parallel_model.py", line 158, in model = ParallelModel(model, GPU_COUNT) File "parallel_model.py", line 34, in init self.inner_model = keras_model File "C:\Users\gana\AppData\Local\Programs\Python\Python35\lib\site-packages\keras\engine\network.py", line 310, in setattr 'It looks like you are subclassing Model and you ' RuntimeError: It looks like you are subclassing Model and you forgot to call super(YourClass, self).__init__(). Always start with this line.

I have tried other solutions that mentioned in this community Now should i downgrade my version as suggested below? i actually dont wan to do so...what is the solution? "in order to use multiple GPUs I needed to downgrade keras 2.2.2 to kera 2.1.3"

skywalkerisnull commented 5 years ago

Try replacing your current parallel_model.py with this one: https://gist.github.com/skywalkerisnull/cebc1fc2b00fa76da92173d2baa21714

chAwater commented 5 years ago

Please check PR #1241 / #1261, or use Keras 2.1.3 (#511)

ganav commented 5 years ago

Try replacing your current parallel_model.py with this one: https://gist.github.com/skywalkerisnull/cebc1fc2b00fa76da92173d2baa21714

thanks for your help. But having same error BTW what is difference between original one and yours?

skywalkerisnull commented 5 years ago

It is a merge of a few of the PR's specific to the errors on that you have. I also had the issues when I went to a multi-gpu environment and I found that I needed to use parts from multi PR's to make it work.

Is it the same error? Or a different one now?

isabelatelles commented 5 years ago

I've had the same issue using keras 2.2.4 and tf-gpu 1.13.1.

c2012 commented 5 years ago

I got the same issue with keras 2.2.4, and I tried to downgrade to keras 2.1.3, it's training without problems now.

BenoCharlo commented 5 years ago

It is a merge of a few of the PR's specific to the errors on that you have. I also had the issues when I went to a multi-gpu environment and I found that I needed to use parts from multi PR's to make it work.

Is it the same error? Or a different one now?

Tried your code. But still having errors generated. This time is MaybeEncodingError: Error sending result: '([array([[[[-123.7, -116.8, -103.9], ... Reason: 'error("'i' format requires -2147483648 <= number <= 2147483647",)'

Is it due to dtypes of float32?

Harshitgupta1023 commented 4 years ago

I got the same issue with keras 2.2.4, and I tried to downgrade to keras 2.1.3, it's training without problems now.

It worked THANK YOU

Wlamit39 commented 2 years ago

I am getting the same issue while running in Tensorflow version 2.6.2 and Keras version 2.6.0. I tried using older versions of Keras and TensorFlow but couldn't install TensorFlow 1.13.1 so used the latest versions of these. If anyone has already solved this in this version please share the solution.

DanangWibisono commented 2 months ago

Excuse me how can i fix this error:

024-09-24 17:56:39.141510: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'cudart64_110.dll'; dlerror: cudart64_110.dll not found 2024-09-24 17:56:39.142065: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine. Traceback (most recent call last): File "", line 1, in File "", line 259, in load_module File "C:\Users\muhda\AppData\Local\Programs\Python\Python38\lib\site-packages\mask_rcnn_tf2-1.0-py3.8.egg\mrcnn\model.py", line 27, in ModuleNotFoundError: No module named 'parallel_model'