open-mmlab/mmengine

[Bug] NameError: name 'OptimWrapper' is not defined, when i used mmdeploy in jetson

Closed this issue · 2 comments

Prerequisite

Environment

I can't run the check_env.py, it get the same error. And i install the pytorch according the DOC.

# packages in environment at /home/jetson/archiconda3/envs/mmdeploy:
#
# Name                    Version                   Build  Channel
_openmp_mutex             4.5                       2_gnu    conda-forge
aenum                     3.1.15                    <pip>
appdirs                   1.4.4                     <pip>
bzip2                     1.0.8                hf897c2e_4    conda-forge
ca-certificates           2018.03.07                    0    c4aarch64
certifi                   2023.11.17                <pip>
charset-normalizer        3.3.2                     <pip>
click                     8.1.7                     <pip>
contourpy                 1.1.1                     <pip>
cycler                    0.12.1                    <pip>
Cython                    3.0.5                     <pip>
dill                      0.3.7                     <pip>
filelock                  3.13.1                    <pip>
fonttools                 4.45.0                    <pip>
grpcio                    1.59.3                    <pip>
h5py                      3.10.0                    <pip>
idna                      3.4                       <pip>
importlib-resources       6.1.1                     <pip>
Jinja2                    3.1.2                     <pip>
kiwisolver                1.4.5                     <pip>
ld_impl_linux-aarch64     2.39                 ha75b1e8_0    conda-forge
libffi                    3.4.2                h3557bc0_5    conda-forge
libgcc-ng                 12.2.0              h607ecd0_19    conda-forge
libgomp                   12.2.0              h607ecd0_19    conda-forge
libnsl                    2.0.0                hf897c2e_0    conda-forge
libsqlite                 3.40.0               hf9034f9_0    conda-forge
libuuid                   2.32.1            hf897c2e_1000    conda-forge
libzlib                   1.2.13               h4e544f5_4    conda-forge
Mako                      1.3.0                     <pip>
MarkupSafe                2.1.3                     <pip>
matplotlib                3.7.4                     <pip>
mmcv                      2.0.0                     <pip>
mmdeploy                  1.3.0                     <pip>
mmdet                     3.2.0                     <pip>
mpmath                    1.3.0                     <pip>
multiprocess              0.70.15                   <pip>
ncurses                   6.3                  headf329_1    conda-forge
ndindex                   1.7                       <pip>
networkx                  3.1                       <pip>
numpy                     1.24.4                    <pip>
onnx                      1.15.0                    <pip>
opencv-python             4.8.1.78                  <pip>
openssl                   3.0.7                h4e544f5_0    conda-forge
packaging                 23.2                      <pip>
Pillow                    10.1.0                    <pip>
pip                       22.3.1             pyhd8ed1ab_0    conda-forge
platformdirs              4.0.0                     <pip>
prettytable               3.9.0                     <pip>
protobuf                  3.20.2                    <pip>
pycocotools               2.0.7                     <pip>
pycuda                    2023.1                    <pip>
pyparsing                 3.1.1                     <pip>
python                    3.8.13          h92ab765_0_cpython    conda-forge
python-dateutil           2.8.2                     <pip>
pytools                   2023.1.1                  <pip>
PyYAML                    6.0.1                     <pip>
readline                  8.1.2                h38e3740_0    conda-forge
requests                  2.31.0                    <pip>
scipy                     1.10.1                    <pip>
setuptools                65.5.1             pyhd8ed1ab_0    conda-forge
shapely                   2.0.2                     <pip>
six                       1.16.0                    <pip>
sqlite                    3.40.0               h69ca7e5_0    conda-forge
sympy                     1.12                      <pip>
tensorrt                  8.5.2.2                   <pip>
terminaltables            3.1.10                    <pip>
tk                        8.6.12               hd8af866_0    conda-forge
torch                     2.0.0+nv23.5              <pip>
torchvision               0.16.1                    <pip>
tqdm                      4.66.1                    <pip>
urllib3                   2.1.0                     <pip>
versioned-hdf5            1.6.0                     <pip>
wcwidth                   0.2.11                    <pip>
wheel                     0.38.4             pyhd8ed1ab_0    conda-forge
xz                        5.2.6                h9cdd2b7_0    conda-forge
zipp                      3.17.0                    <pip>

Reproduces the problem - code sample

I run the demo in mmdeploy.

python ./tools/deploy.py \
    configs/mmdet/detection/detection_tensorrt_dynamic-320x320-1344x1344.py \
    $PATH_TO_MMDET/configs/retinanet/retinanet_r18_fpn_1x_coco.py \
    retinanet_r18_fpn_1x_coco_20220407_171055-614fd399.pth \
    $PATH_TO_MMDET/demo/demo.jpg \
    --work-dir work_dir \
    --show \
    --device cuda:0 \
    --dump-info

Reproduces the problem - command or script

python ./tools/deploy.py \
    configs/mmdet/detection/detection_tensorrt_dynamic-320x320-1344x1344.py \
    $PATH_TO_MMDET/configs/retinanet/retinanet_r18_fpn_1x_coco.py \
    retinanet_r18_fpn_1x_coco_20220407_171055-614fd399.pth \
    $PATH_TO_MMDET/demo/demo.jpg \
    --work-dir work_dir \
    --show \
    --device cuda:0 \
    --dump-info

Reproduces the problem - error message

NameError: name 'OptimWrapper' is not defined
Screenshot from 2023-11-21 19-15-19

Additional information

No response

If you get the same problem, pls go to the https://github.com/da13132/mmengine-for-jetson, thank you da13132.