mmpose icon indicating copy to clipboard operation
mmpose copied to clipboard

There are some problems in the dev1.0 branch torch2onnx, some modules seem to be from the master branch?

Open chen-del opened this issue 2 years ago • 4 comments

There is a problem with mmpose1.0 series export, the error seems to be that the environment is not compatible and the error is as follows:

  1. Traceback (most recent call last): File "tools/deployment/pytorch2onnx.py", line 8, in from mmpose.apis import init_pose_model ImportError: cannot import name 'init_pose_model' from 'mmpose.apis' (/home/dell/bag-torch/darkpull/Paddle/mmpose/mmpose/apis/init.py)

  2. After modification as follows: pytorch2onnx.py

# from mmpose.apis import init_pose_model
from mmpose.apis import init_model

Traceback (most recent call last): File "tools/deployment/pytorch2onnx.py", line 17, in from mmcv.onnx.symbolic import register_extra_symbolics ModuleNotFoundError: No module named 'mmcv.onnx'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "tools/deployment/pytorch2onnx.py", line 19, in raise NotImplementedError('please update mmcv to version>=1.0.4') NotImplementedError: please update mmcv to version>=1.0.4

chen-del avatar Nov 21 '22 02:11 chen-del

Thanks for using MMPose. Please note that pytorch2onnx.py is deprecated in MMPose and will be removed from 1.x. The model export and deployment are supported by MMDepoly. Please refer to MMDeploy's documents for details:

  • MMDeploy 1.x for MMPose 1.x: https://mmdeploy.readthedocs.io/en/dev-1.x/04-supported-codebases/mmpose.html
  • MMDeploy 0.x for MMPose 0.x: https://mmdeploy.readthedocs.io/en/latest/04-supported-codebases/mmpose.html

ly015 avatar Nov 21 '22 02:11 ly015

Okay, thank you. It can be exported and used normally. The main reason is that it is a little different from the master branch. I am not used to it for the time being?

chen-del avatar Nov 21 '22 16:11 chen-del

Yes, MMPose 1.0 introduced major refactoring and unavoidable breaking changes. We have prepared a document to introduce the design of MMPose 1.0 and how to migrate from the old version. Hope it will help: https://mmpose.readthedocs.io/en/1.x/migration.html

ly015 avatar Nov 22 '22 02:11 ly015

Okay, thank you. It can be exported and used normally. The main reason is that it is a little different from the master branch. I am not used to it for the time being?

What code did you change to export onnx model in mmpose1.x ? I'm also having the same issue.

dengtianbi avatar Jan 06 '23 10:01 dengtianbi