gromero commented on PR #11108:
URL: https://github.com/apache/tvm/pull/11108#issuecomment-1108613361

   @jiangjiajun Hi. Thanks for reporting this issue and for the fix.
   
   I think paddle import kind violates the expectation that `FILE` is always a 
file on `tvmc compile`...
   
   @jiangjiajun @leandron My preference for consistence here is to keep `FILE` 
argument being passed to `tvmc compile` as only a file  (not a directory). In 
this case we would need to change the current behavior to load a paddle model 
passing a `model_name.pmodel` file, for example:
   
   ```$ tvmc compile --target "llvm" 
~/scripts/picodet_PPLCNet_x2_5_mainbody_lite_v1.0_infer/inference.pdmodel```
   
   instead of a directory as we do currently. Then it would be necessary to 
change `class PaddleFrontend`, [load() 
method](https://github.com/apache/tvm/blob/main/python/tvm/driver/tvmc/frontends.py#L273)
 to use maybe `os.path.splitext()` to acquire the "Directory path to save model 
+ model name without suffix" expected by Paddle's 
[load_inference_model](https://www.paddlepaddle.org.cn/documentation/docs/en/api/paddle/static/load_inference_model_en.html).
   
   This would also have the benefit that the model format could now be guessed 
for Paddle as well.  ( @jiangjiajun I think that before this issue one needed 
to pass explicitly the model format  for Paddle models (i.e. `--model-format 
paddle`) since although we have `suffixes()` properly in place for Paddle there 
is no way `guess_frontend()` can use it when `FILE` is in the 
`inference_model/model_name` form?)
   
   Finally, we need a test case for compiling a simple paddle model to avoid 
such kind of regressions (to be submitted with this PR also).
   
   @jiangjiajun @leandron WDYT?


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to