AttributeError: 'NoneType' object has no attribute 'replace'
神经网络训练中出现此错误,说明在自定义网络层中定义了一个self.add_weight但没有给它命名,
如下即可解决
self.weight = self.add_weight(name='w', shape=(input_shape[-1], self.units)
AttributeError: 'NoneType' object has no attribute 'replace'
神经网络训练中出现此错误,说明在自定义网络层中定义了一个self.add_weight但没有给它命名,
如下即可解决
self.weight = self.add_weight(name='w', shape=(input_shape[-1], self.units)