Python AttributeError:模块没有属性';注册软件&x27;

Python AttributeError:模块没有属性';注册软件&x27;,python,tensorflow,Python,Tensorflow,我使用的是TensorFlow 1.14版本和python 3.6。 我得到的错误如下: "AttributeError: module 'tensorflow.python.framework.ops' has no attribute 'RegisterShape'" This is my source code : ops.RegisterShape("ZeroInitializer")(None) def _InitOpDefLibrary(op_list_proto_by

我使用的是TensorFlow 1.14版本和python 3.6。 我得到的错误如下:

"AttributeError: module 'tensorflow.python.framework.ops' has no attribute 'RegisterShape'"

This is my source code :

ops.RegisterShape("ZeroInitializer")(None)

    def _InitOpDefLibrary(op_list_proto_bytes):
      op_list = _op_def_pb2.OpList()
      op_list.ParseFromString(op_list_proto_bytes)
      _op_def_registry.register_op_list(op_list)
      op_def_lib = _op_def_library.OpDefLibrary()
      op_def_lib.add_op_list(op_list)
      return op_def_lib

我在Ubuntu中工作,无法在C/C++ > /P>中创建/登记操作,核心OP通过RealStestOP(…)SetShapeFn(…)移动到C++。因此,您可能必须首先在C++中创建/登记操作。可以找到完整的引导,为核心OPS的形状函数通过ReavestyOP(…)SetShapeFn移动到C++。因此,您可能必须首先在C++中创建/登记操作。可以找到完整的指南