AttributeError: module 'tensorflow.python.framework.ops' has no attribute 'RegisterShape'
问题 I am using TensorFlow 2.1.0-dev20191125 Unfortunately I can't compile a simple example with error: "AttributeError: module 'tensorflow.python.framework.ops' has no attribute 'RegisterShape'" My source code: from tensorflow.python.framework import ops as _ops _ops.RegisterShape("GRUBlockCell")(None) Is it looks like incorrectly installed TF ? 回答1: Shape functions for core ops were moved to C++ via REGISTER_OP(...).SetShapeFn(...) . So you may have to first create/register your operation in C++