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

萝らか妹 提交于 2021-02-11 17:41:54

问题


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++.

A detailed guide can be found in the official doumentation Here



来源:https://stackoverflow.com/questions/59043649/attributeerror-module-tensorflow-python-framework-ops-has-no-attribute-regis

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!