Mask_rcnn: AttributeError: module 'tensorflow' has no attribute '__version__'

Created on 19 Jul 2018  路  4Comments  路  Source: matterport/Mask_RCNN

When I run the first part of the demo, I get the following error:

Traceback (most recent call last):
File "demo.py", line 16, in
import mrcnn.model as modellib
File "/data/harryyhw/Mask_RCNN/mrcnn/model.py", line 31, in
assert LooseVersion(tf.__version__) >= LooseVersion("1.3")
AttributeError: module 'tensorflow' has no attribute '__version__'

How do I fix this?

Most helpful comment

you might have tried to uninstall and install tensorflow. There are chances of the environment using 2 kinds of tensorflows. Try creating a new environment and start fresh it would work. And never place with the tensorflow versions again.

All 4 comments

try change tf.version to tf.__version__ in the model.py code

it is __version__ in the code, sorry! my previous post didn't show this because the underscores were treated as formatting by GitHub.

you might have tried to uninstall and install tensorflow. There are chances of the environment using 2 kinds of tensorflows. Try creating a new environment and start fresh it would work. And never place with the tensorflow versions again.

@preethamsridhar is right. at least in my case that was the root cause of this error.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

taewookim picture taewookim  路  4Comments

canerozer picture canerozer  路  3Comments

Mabinogiysk picture Mabinogiysk  路  3Comments

LifeBeyondExpectations picture LifeBeyondExpectations  路  4Comments

ziyigogogo picture ziyigogogo  路  3Comments