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

Problem with demo.ipynb (model = modellib.MaskRCNN(mode="inference", model_dir=MODEL_DIR, config=config) #1828 #2569

Open israr0541 opened 3 years ago

israr0541 commented 3 years ago

AttributeError Traceback (most recent call last)

in () 1 # Create model object in inference mode. ----> 2 model = modellib.MaskRCNN(mode="inference", model_dir=MODEL_DIR, config=config) 3 # Load weights trained on MS-COCO 4 model.load_weights(COCO_MODEL_PATH, by_name=True) 7 frames /usr/local/lib/python3.7/dist-packages/tensorflow/python/autograph/impl/api.py in wrapper(*args, **kwargs) 668 except Exception as e: # pylint:disable=broad-except 669 if hasattr(e, 'ag_error_metadata'): --> 670 raise e.ag_error_metadata.to_exception(e) 671 else: 672 raise AttributeError: in user code: /content/Mask_RCNN/mrcnn/model.py:390 call * roi_level = log2_graph(tf.sqrt(h * w) / (224.0 / tf.sqrt(image_area))) /content/Mask_RCNN/mrcnn/model.py:341 log2_graph * return tf.log(x) / tf.log(2.0) AttributeError: module 'tensorflow' has no attribute 'log'
lichq commented 2 years ago

same question..

lichq commented 2 years ago

Hi I solved this problem by changing tf.log to tf.math.log in model.py. It works for me. Also, you can change your version of tensorflow=1.15.0