AttributeError: 'NoneType' object has no attribute '. inbound. nodes

问题:
AttributeError: 'NoneType' object has no attribute '. inbound. nodes
原因:
tensorflow的代码和keras的代码不兼容

解决方法:
右边是在左边的代码的基础上改进的,加了一个tensorflow代码的函数,所以把函数中tensorflow代码的样式改成keras就解决了。
AttributeError: 'NoneType' object has no attribute '. inbound. nodes