The article below introduces a new solution!
The story of downgrading the version of tensorflow in the demo of Mask R-CNN.
** Deep learning super beginner ** is the story that solved the error. I wrote an article in the hope that it would help someone.
If you want to use Mask R-CNN for image recognition, the shortcut is to use the code Mask_RCNN from matterport.
https://github.com/matterport/Mask_RCNN
I didn't understand even after reading this much, so while reading the following site, I tried to run demo.ipynb on Google cola boratory.
https://tech-blog.optim.co.jp/entry/2019/03/28/173000 http://maruo51.com/2020/02/22/mrcnn/
However! Even if you try to execute it as it is
AttributeError: module 'tensorflow' has no attribute 'log'
Will occur. (As of April 20, 2020)
So, I tried and errored for about two days to solve this, so I will write it down.
The reference is like the trouble consultation box on github shown below.
https://github.com/matterport/Mask_RCNN/issues/1797#
It's all in English, but when I tried my best to read it, I found a post that would give me a hint.
tf.log() -> tf.math.log()
tf.sets.set_intersection() -> tf.sets.intersection()
tf.sparse_tensor_to_dense() -> tf.sparse.to_dense()
tf.to_float() -> tf.cast([value], tf.float32)
Apparently, it seems to be an error caused by a different version of tensorflow and a changed method.
You should rewrite the relevant part of mrcnn / model.py exactly like this.
It should be noted that instead of going to the end of the error and then modifying model.py ** Rewriting model.py immediately after first cloning the repository **.
** It seems that it was solved by proceeding with setup etc. in the modified model.py **. (Somehow, I think it's a makeshift solution, so If anyone knows the real cause, please let me know. )
case being settled! I hope you find it helpful!
Recommended Posts