You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2022/11/01 20:54:10 UTC

[GitHub] [tvm] apivovarov opened a new pull request, #13260: [TF2] Import graph_def to default graph before calling function_def_to_graph_def

apivovarov opened a new pull request, #13260:
URL: https://github.com/apache/tvm/pull/13260

   This PR Imports `graph_def` to default graph before calling `function_def_to_graph_def()`.
   
   It is needed for `function_def_to_graph_def(func, inshape)` which is called inside `from_tensorflow(graph_def)`.
   
   The `func` might have a reference(s) by name to another function(s) in the graph_def functions library. Internally `function_def_to_graph_def()` checks if another function is actually a function using [graph._is_function(fname)](https://github.com/tensorflow/tensorflow/blob/v2.9.0/tensorflow/python/framework/function_def_to_graph.py#L141)
   
   We need to import `graph_def` to the default context / graph before calling `function_def_to_graph_def()`. Otherwise we might face errors such as the following
   ```
     File "/Users/pivovaa/miniconda3/lib/python3.8/site-packages/tensorflow/python/framework/function_def_to_graph.py", line 258, in function_def_to_graph_def
       raise ValueError(f"Function {fname} was not found. Please make sure "
   ValueError: Function __inference_map_while_Preprocessor_ResizeToRange_cond_true_18925_191476 was not found. Please make sure the FunctionDef `fdef` is correct.
   ```
   
   
   ### Testing
   Tested on custom TF2 model compilation. After the fix the compilation works fine. 
   
   The model has the following functions relationships btw functions in the functions library
   ```
   func.signature.name:__inference_map_while_body_18879_191591
   
   =============== node_def ====================
   name: "map/while/Preprocessor/ResizeToRange/cond"
   op: "StatelessIf"
   input: "map/while/Preprocessor/ResizeToRange/Less:z:0"
   input: "map/while/Preprocessor/unstack:output:0"
   attr {
     key: "else_branch"
     value {
       func {
         name: "__inference_map_while_Preprocessor_ResizeToRange_cond_false_18926_190800"
       }
     }
   }
   attr {
     key: "then_branch"
     value {
       func {
         name: "__inference_map_while_Preprocessor_ResizeToRange_cond_true_18925_191476"
       }
     }
   }
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [tvm] tvm-bot commented on pull request #13260: [TF2] Import graph_def to default graph before calling function_def_to_graph_def

Posted by GitBox <gi...@apache.org>.
tvm-bot commented on PR #13260:
URL: https://github.com/apache/tvm/pull/13260#issuecomment-1299136711

   <!---bot-comment-->
   
   Thanks for contributing to TVM! Please refer to the contributing guidelines https://tvm.apache.org/docs/contribute/ for useful information and tips. Please request code reviews from [Reviewers](https://github.com/apache/incubator-tvm/blob/master/CONTRIBUTORS.md#reviewers) by @-ing them in a comment.
   
   <!--bot-comment-ccs-start-->
    * No users to tag found in teams: `tf2` <sub>See [#10317](https://github.com/apache/tvm/issues/10317) for details</sub><!--bot-comment-ccs-end-->
   
   <sub>Generated by [tvm-bot](https://github.com/apache/tvm/blob/main/ci/README.md#github-actions)</sub>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [tvm] masahi commented on pull request #13260: [Frontend][Tensorflow2] Import graph_def to default graph before calling function_def_to_graph_def

Posted by GitBox <gi...@apache.org>.
masahi commented on PR #13260:
URL: https://github.com/apache/tvm/pull/13260#issuecomment-1299717727

   @tvm-bot rerun


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [tvm] apivovarov commented on pull request #13260: [Frontend][Tensorflow2] Import graph_def to default graph before calling function_def_to_graph_def

Posted by GitBox <gi...@apache.org>.
apivovarov commented on PR #13260:
URL: https://github.com/apache/tvm/pull/13260#issuecomment-1301373287

   @masahi All checks have passed in CI. Can you have a look at this PR?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [tvm] masahi merged pull request #13260: [Frontend][Tensorflow2] Import graph_def to default graph before calling function_def_to_graph_def

Posted by GitBox <gi...@apache.org>.
masahi merged PR #13260:
URL: https://github.com/apache/tvm/pull/13260


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org