概述
1. AttributeError: module 'tensorflow' has no attribute 'log'
问题:tf.log报错
解决:tf.math.log
2.I had this same problem. It seems according to the poorly-documented TF source code, keras.engine.saving was mostly moved to keras.saving.
you want to replace
from keras import saving
with
from tensorflow.python.keras.saving import hdf5_format
then you will also want to replace the lines
saving.load_weights_from_hdf5_group(f, layers)
and so on with
hdf5_format.load_weights_from_hdf5_group(f, layers)
Hopefully this helps you and anyone else trying to use this repo in 2020.
3.The following Variables were created within a Lambda layer (anchors)
just change that line with
anchor_layer = AnchorsLayer(name="anchors")
anchors = anchor_layer(anchors)
But before that you should define this class:
class AnchorsLayer(tf.keras.layers.Layer):
def __init__(self, name="anchors", **kwargs):
super(AnchorsLayer, self).__init__(name=name, **kwargs)
def call(self, anchor):
return anchor
def get_config(self) :
config = super(AnchorsLayer, self).get_config()
return config
错误尚未完全解决,安装了和代码匹配的tensorflow-gpu,代码可以正常进行训练和预测。
参考文献:
1.AttributeError: module 'tensorflow' has no attribute 'log'
2.Which weights to start with?
3.Variables were created within a Lambda layer (anchors)
4.基于Tensorflow2.1的Mask RCNN兼容性问题(Variables were created within a Lambda layer (anchors))
最后
以上就是无奈身影为你收集整理的tensorflow 2.2 matterport/Mask_RCNN 调试笔记的全部内容,希望文章能够帮你解决tensorflow 2.2 matterport/Mask_RCNN 调试笔记所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复