-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Frontend] [Tensorflow] ReadVariableOp operator support #4952
Conversation
# Add list of other operators as well which get removed | ||
# and are not needed for inference. | ||
# Other approach is instead of raising error, we can freeze the graph. | ||
if 'ReadVariableOp' in missing_operators: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any other op falling into this case? If so, I suggest we create a list containing all these ops.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, there are.
I will compile the list and add it in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added other operators as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks @maheshambule |
Thanks, @kevinthesun for review and comments. |
* tf frontend read variable op * pylint fix * tf frontend freezed graph pruned ops
* tf frontend read variable op * pylint fix * tf frontend freezed graph pruned ops
The ReadVariableOp gets eliminated when you freeze the TensorFlow graph. It is also not needed for the inference.
https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/framework/graph_util_impl.py#L464
If we find a ReadVariableOp in a TF graph, we error out and ask the user to provide a frozen graph.
TODO -
We may want to add support where we freeze the graph on the user's behalf when it is possible to freeze it otherwise we will throw an error.
@yongwww, @zhiics, @kevinthesun, @FrozenGene
Could you please review the PR?