首页 > 解决方案 > AttributeError:模块'tensorflow'在Mask RCNN实施期间没有属性'log'

问题描述

我尝试将日志更改为 math.log 并将 tensorflow 版本降级为 1.4 但仍然出现错误。有人可以帮忙。谢谢。AttributeError:在用户代码中:

/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'

标签: google-colaboratoryfaster-rcnn

解决方案


这个问题是由于向后兼容造成的。

它适用于我使用python 3.6以下要求:

numpy<2.0,>=1.16.0
scipy
Pillow
cython
matplotlib
scikit-image>=0.14.2
tensorflow==1.15.3
keras==2.2.4
opencv-python
h5py
imgaug

推荐阅读