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 2020/12/08 15:14:17 UTC

[GitHub] [tvm] fprotopapa opened a new pull request #7059: #7058 [Tutorial] Import errors in deploy_detection.py and deploy_classification.py

fprotopapa opened a new pull request #7059:
URL: https://github.com/apache/tvm/pull/7059


   I ran into import errors while following the VTA tutorial for 'Deploy Pretrained Vision Model from MxNet on VTA' under Ubuntu 18.04.5 LTS and Docker images created with Dockerfile.ci_cpu. Scripts launched from tvm base directory.
   
   File: tvm/vta/tutorials/frontend/deploy_classification.py
   In line 59 to 61:
   
          import vta
          from vta.testing import simulator
          from vta.top import graph_pack
   
   Import paths have changed and function call for graph_pack in line 181.
   
   Changed to:
   
          import vta
          from vta.python.vta.testing import simulator
          from vta.python.vta.top import graphpack as graph_pack
          from vta.python import vta
   
   and in line 181
   
           relay_prog = graph_pack.graph_pack(
   
   Similiar issue in file tvm/vta/tutorials/frontend/legacy/deploy_detection.py
   
   Line 58 to 64 and function call in line 222:
   
          from tvm import rpc, autotvm, relay
          from tvm.relay.testing import yolo_detection, darknet
          from tvm.relay.testing.darknet import __darknetffi__
          from tvm.contrib import graph_runtime, graph_runtime, util
          from tvm.contrib.download import download_testdata
          from vta.testing import simulator
          from vta.top import graph_pack
   
   Changed to:
   
          from tvm import rpc, autotvm, relay
          from tvm.relay.testing import yolo_detection, darknet
          from tvm.relay.testing.darknet import __darknetffi__
          from tvm.contrib import graph_runtime, graph_runtime, utils
          from tvm.contrib.download import download_testdata
          from vta.python.vta.testing import simulator
          from vta.python.vta.top import graphpack as graph_pack
          from vta.python import vta
   and
   
           mod = graph_pack.graph_pack(
   
   Also layer id for stop layer 'cast' changed from 185 to 186 in line 126.
   


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

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



[GitHub] [tvm] liangfu commented on a change in pull request #7059: #7058 [Tutorial] Import errors in deploy_detection.py and deploy_classification.py

Posted by GitBox <gi...@apache.org>.
liangfu commented on a change in pull request #7059:
URL: https://github.com/apache/tvm/pull/7059#discussion_r539806853



##########
File path: vta/tutorials/frontend/legacy/deploy_detection.py
##########
@@ -58,7 +58,7 @@
 from tvm import rpc, autotvm, relay
 from tvm.relay.testing import yolo_detection, darknet
 from tvm.relay.testing.darknet import __darknetffi__
-from tvm.contrib import graph_runtime, graph_runtime, util
+from tvm.contrib import graph_runtime, graph_runtime, utils

Review comment:
       Do you mind remove the duplicated `graph_runtime` here as well?




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

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



[GitHub] [tvm] tmoreau89 merged pull request #7059: #7058 [Tutorial] Import errors in deploy_detection.py and deploy_classification.py

Posted by GitBox <gi...@apache.org>.
tmoreau89 merged pull request #7059:
URL: https://github.com/apache/tvm/pull/7059


   


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

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



[GitHub] [tvm] codgeek edited a comment on pull request #7059: #7058 [Tutorial] Import errors in deploy_detection.py and deploy_classification.py

Posted by GitBox <gi...@apache.org>.
codgeek edited a comment on pull request #7059:
URL: https://github.com/apache/tvm/pull/7059#issuecomment-761728734


   Thanks for fixing it! I've run into this bug too on [Dec 10 01:26:05 2020 version](https://github.com/apache/tvm/tree/ffb6029de15c468a4a1024a86ca1daa4ad18bb51) code. 
   
   After this fix, I am using the [newest version code of 'Fri Jan 15 07:59:28 2021'](https://github.com/apache/tvm/tree/c9474639dd3761b78a457ab274603d87a3dcf9b8), there is another error when running `python vta/tutorials/frontend/legacy/deploy_detection.py` on pynq Z1 board.  on pynq Z1 board. actually this error occurs on`graph_pack()` stage, still on host, not on Z1. 
   ```
   File "vta/tutorials/frontend/legacy/deploy_detection.py", line 243, in <module>
       stop_name_idx=pack_dictMODEL_NAME,
     Check failed: false == false: [00:55:37]  tvm/src/relay/op/tensor/transform.cc:703: 
     Check failed: oshape_sum == data_shape_sum (172380 vs. 173056) : Input tensor shape and reshaped shape are not compatible
   ```
   
   Did your `deploy_detection.py` run successfully?  @fprotopapa  looking forward to you practice.
   
   


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

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



[GitHub] [tvm] tmoreau89 commented on pull request #7059: #7058 [Tutorial] Import errors in deploy_detection.py and deploy_classification.py

Posted by GitBox <gi...@apache.org>.
tmoreau89 commented on pull request #7059:
URL: https://github.com/apache/tvm/pull/7059#issuecomment-742899105


   Thank you @fprotopapa and @liangfu and @vegaluisjose for reviewing the 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.

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



[GitHub] [tvm] zhiics commented on pull request #7059: #7058 [Tutorial] Import errors in deploy_detection.py and deploy_classification.py

Posted by GitBox <gi...@apache.org>.
zhiics commented on pull request #7059:
URL: https://github.com/apache/tvm/pull/7059#issuecomment-740770904


   cc @tmoreau89 @vegaluisjose @liangfu 


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

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



[GitHub] [tvm] fprotopapa commented on a change in pull request #7059: #7058 [Tutorial] Import errors in deploy_detection.py and deploy_classification.py

Posted by GitBox <gi...@apache.org>.
fprotopapa commented on a change in pull request #7059:
URL: https://github.com/apache/tvm/pull/7059#discussion_r539306511



##########
File path: vta/tutorials/frontend/deploy_classification.py
##########
@@ -56,9 +56,14 @@
 from tvm.contrib.debugger import debug_runtime
 from tvm.relay import transform
 
+os.chdir(dirname(os.path.abspath(__file__)))
+os.chdir(join(pardir, pardir, pardir))
+sys.path.append(os.getcwd())

Review comment:
       Thanks! You're right. The import errors were my own fault. I reversed these changes and updated the PR description. 




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

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



[GitHub] [tvm] codgeek edited a comment on pull request #7059: #7058 [Tutorial] Import errors in deploy_detection.py and deploy_classification.py

Posted by GitBox <gi...@apache.org>.
codgeek edited a comment on pull request #7059:
URL: https://github.com/apache/tvm/pull/7059#issuecomment-761728734


   Thanks for fix it! I've run into this bug too on [Dec 10 01:26:05 2020 version](https://github.com/apache/tvm/tree/ffb6029de15c468a4a1024a86ca1daa4ad18bb51) code. 
   
   After this fix, I am using the [newest version code of 'Fri Jan 15 07:59:28 2021'](https://github.com/apache/tvm/tree/c9474639dd3761b78a457ab274603d87a3dcf9b8)  on pynq Z1 board. actually this error occurs on`graph_pack()` stage, still on host, not on Z1. 
   ```
   File "vta/tutorials/frontend/legacy/deploy_detection.py", line 243, in <module>
       stop_name_idx=pack_dictMODEL_NAME,
     Check failed: false == false: [00:55:37]  tvm/src/relay/op/tensor/transform.cc:703: 
     Check failed: oshape_sum == data_shape_sum (172380 vs. 173056) : Input tensor shape and reshaped shape are not compatible
   ```
   
   Did your `deploy_detection.py` run successfully?  @fprotopapa  looking forward to you practice.
   
   


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

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



[GitHub] [tvm] codgeek edited a comment on pull request #7059: #7058 [Tutorial] Import errors in deploy_detection.py and deploy_classification.py

Posted by GitBox <gi...@apache.org>.
codgeek edited a comment on pull request #7059:
URL: https://github.com/apache/tvm/pull/7059#issuecomment-761728734


   Thanks for fixing it! I've run into this bug too on [Dec 10 01:26:05 2020 version](https://github.com/apache/tvm/tree/ffb6029de15c468a4a1024a86ca1daa4ad18bb51) code. 
   
   After this fix, I am using the [newest version code of 'Fri Jan 15 07:59:28 2021'](https://github.com/apache/tvm/tree/c9474639dd3761b78a457ab274603d87a3dcf9b8)  on pynq Z1 board. actually this error occurs on`graph_pack()` stage, still on host, not on Z1. 
   ```
   File "vta/tutorials/frontend/legacy/deploy_detection.py", line 243, in <module>
       stop_name_idx=pack_dictMODEL_NAME,
     Check failed: false == false: [00:55:37]  tvm/src/relay/op/tensor/transform.cc:703: 
     Check failed: oshape_sum == data_shape_sum (172380 vs. 173056) : Input tensor shape and reshaped shape are not compatible
   ```
   
   Did your `deploy_detection.py` run successfully?  @fprotopapa  looking forward to you practice.
   
   


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

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



[GitHub] [tvm] codgeek commented on pull request #7059: #7058 [Tutorial] Import errors in deploy_detection.py and deploy_classification.py

Posted by GitBox <gi...@apache.org>.
codgeek commented on pull request #7059:
URL: https://github.com/apache/tvm/pull/7059#issuecomment-761728734


   Thanks for fix it! I've run into this bug too on [Dec 10 01:26:05 2020 version](https://github.com/apache/tvm/tree/ffb6029de15c468a4a1024a86ca1daa4ad18bb51) code. 
   
   After this fix, there is another error when running`python vta/tutorials/frontend/legacy/deploy_detection.py` on pynq Z1 board. actually this error occurs on`graph_pack()` stage, still on host, not on Z1. 
   ```
   File "vta/tutorials/frontend/legacy/deploy_detection.py", line 243, in <module>
       stop_name_idx=pack_dictMODEL_NAME,
     Check failed: false == false: [00:55:37]  tvm/src/relay/op/tensor/transform.cc:703: 
     Check failed: oshape_sum == data_shape_sum (172380 vs. 173056) : Input tensor shape and reshaped shape are not compatible
   ```
   
   Did your `deploy_detection.py` run successfully?  @fprotopapa  looking forward to you practice.
   
   


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

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



[GitHub] [tvm] fprotopapa commented on a change in pull request #7059: #7058 [Tutorial] Import errors in deploy_detection.py and deploy_classification.py

Posted by GitBox <gi...@apache.org>.
fprotopapa commented on a change in pull request #7059:
URL: https://github.com/apache/tvm/pull/7059#discussion_r540069099



##########
File path: vta/tutorials/frontend/legacy/deploy_detection.py
##########
@@ -58,7 +58,7 @@
 from tvm import rpc, autotvm, relay
 from tvm.relay.testing import yolo_detection, darknet
 from tvm.relay.testing.darknet import __darknetffi__
-from tvm.contrib import graph_runtime, graph_runtime, util
+from tvm.contrib import graph_runtime, graph_runtime, utils

Review comment:
       Duplicated import is removed.




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

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



[GitHub] [tvm] liangfu commented on a change in pull request #7059: #7058 [Tutorial] Import errors in deploy_detection.py and deploy_classification.py

Posted by GitBox <gi...@apache.org>.
liangfu commented on a change in pull request #7059:
URL: https://github.com/apache/tvm/pull/7059#discussion_r539181597



##########
File path: vta/tutorials/frontend/deploy_classification.py
##########
@@ -56,9 +56,14 @@
 from tvm.contrib.debugger import debug_runtime
 from tvm.relay import transform
 
+os.chdir(dirname(os.path.abspath(__file__)))
+os.chdir(join(pardir, pardir, pardir))
+sys.path.append(os.getcwd())

Review comment:
       CI is complaining about the usage of `__file__` here.
   
   Also, I think we can safely remove these lines here, since TVM is assumed to be exist in users' environment, IMHO.




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

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