Mask_RCNN icon indicating copy to clipboard operation
Mask_RCNN copied to clipboard

parallel_model.py

Open ganav opened this issue 6 years ago • 10 comments

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"

ganav avatar Jul 01 '19 03:07 ganav

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

skywalkerisnull avatar Jul 01 '19 04:07 skywalkerisnull

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

chAwater avatar Jul 01 '19 05:07 chAwater

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?

ganav avatar Jul 01 '19 07:07 ganav

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?

skywalkerisnull avatar Jul 01 '19 10:07 skywalkerisnull

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

isabelatelles avatar Jul 12 '19 13:07 isabelatelles

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.

c2012 avatar Jul 23 '19 08:07 c2012

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?

BenoCharlo avatar Sep 30 '19 15:09 BenoCharlo

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

Harshitgupta1023 avatar Jun 14 '20 12:06 Harshitgupta1023

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.

Wlamit39 avatar Feb 20 '22 11:02 Wlamit39

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'

DanangWibisono avatar Sep 24 '24 11:09 DanangWibisono