tensorflow 2.2 matterport/Mask_RCNN 调试笔记

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))

 

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值