Skip to content

[ut] Ut failed with openvino backend #73

@del-zhenwu

Description

@del-zhenwu

Thanks for your bug report. We appreciate it a lot.

Checklist

  1. I have searched related issues but cannot get the expected help.
  2. I have read the FAQ documentation but cannot get the expected help.
  3. The bug has not been fixed in the latest version.

Describe the bug

[2022-01-13T02:32:51.455Z] ____________________ test_psphead_forward[Backend.OPENVINO] ____________________

[2022-01-13T02:32:51.455Z] 

[2022-01-13T02:32:51.455Z] backend = <Backend.OPENVINO: 'openvino'>

[2022-01-13T02:32:51.455Z] 

[2022-01-13T02:32:51.455Z]     @pytest.mark.parametrize('backend',

[2022-01-13T02:32:51.455Z]                              [Backend.ONNXRUNTIME, Backend.OPENVINO, Backend.NCNN])

[2022-01-13T02:32:51.455Z]     def test_psphead_forward(backend):

[2022-01-13T02:32:51.455Z]         check_backend(backend)

[2022-01-13T02:32:51.455Z]         from mmseg.models.decode_heads import PSPHead

[2022-01-13T02:32:51.456Z]         head = PSPHead(in_channels=32, channels=16, num_classes=19).eval()

[2022-01-13T02:32:51.456Z]     

[2022-01-13T02:32:51.456Z]         deploy_cfg = mmcv.Config(

[2022-01-13T02:32:51.456Z]             dict(

[2022-01-13T02:32:51.456Z]                 backend_config=dict(type=backend.value),

[2022-01-13T02:32:51.456Z]                 onnx_config=dict(output_names=['result'], input_shape=None),

[2022-01-13T02:32:51.456Z]                 codebase_config=dict(type='mmseg', task='Segmentation')))

[2022-01-13T02:32:51.456Z]         inputs = [torch.randn(1, 32, 45, 45)]

[2022-01-13T02:32:51.456Z]         model_inputs = {'inputs': inputs}

[2022-01-13T02:32:51.456Z]         with torch.no_grad():

[2022-01-13T02:32:51.456Z]             model_outputs = get_model_outputs(head, 'forward', model_inputs)

[2022-01-13T02:32:51.456Z]         wrapped_model = WrapModel(head, 'forward')

[2022-01-13T02:32:51.456Z]         rewrite_inputs = {'inputs': inputs}

[2022-01-13T02:32:51.456Z]         rewrite_outputs, is_backend_output = get_rewrite_outputs(

[2022-01-13T02:32:51.456Z]             wrapped_model=wrapped_model,

[2022-01-13T02:32:51.456Z]             model_inputs=rewrite_inputs,

[2022-01-13T02:32:51.456Z] >           deploy_cfg=deploy_cfg)

[2022-01-13T02:32:51.456Z] 

[2022-01-13T02:32:51.456Z] tests/test_codebase/test_mmseg/test_mmseg_models.py:229: 

[2022-01-13T02:32:51.456Z] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

[2022-01-13T02:32:51.456Z] mmdeploy/utils/test.py:519: in get_rewrite_outputs

[2022-01-13T02:32:51.456Z]     deploy_cfg)

[2022-01-13T02:32:51.456Z] mmdeploy/utils/test.py:482: in get_backend_outputs

[2022-01-13T02:32:51.456Z]     device, output_names)

[2022-01-13T02:32:51.456Z] mmdeploy/codebase/base/backend_model.py:76: in _build_wrapper

[2022-01-13T02:32:51.456Z]     ir_model_file=backend_files[0], output_names=output_names)

[2022-01-13T02:32:51.456Z] mmdeploy/backend/openvino/wrapper.py:39: in __init__

[2022-01-13T02:32:51.456Z]     from openvino.inference_engine import IECore

[2022-01-13T02:32:51.456Z] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

[2022-01-13T02:32:51.456Z] 

[2022-01-13T02:32:51.456Z]     import os

[2022-01-13T02:32:51.456Z]     import sys

[2022-01-13T02:32:51.456Z]     

[2022-01-13T02:32:51.456Z]     if sys.platform == 'win32':

[2022-01-13T02:32:51.456Z]         # Installer, yum, pip installs openvino dlls to the different directories

[2022-01-13T02:32:51.456Z]         # and those paths need to be visible to the openvino modules

[2022-01-13T02:32:51.456Z]         #

[2022-01-13T02:32:51.456Z]         # If you're using a custom installation of openvino,

[2022-01-13T02:32:51.456Z]         # add the location of openvino dlls to your system PATH.

[2022-01-13T02:32:51.456Z]         #

[2022-01-13T02:32:51.456Z]         # looking for the libs in the pip installation path by default.

[2022-01-13T02:32:51.456Z]         openvino_libs = [os.path.join(os.path.dirname(__file__), '..', '..', 'openvino', 'libs')]

[2022-01-13T02:32:51.456Z]         # setupvars.bat script set all libs paths to OPENVINO_LIB_PATHS environment variable.

[2022-01-13T02:32:51.456Z]         openvino_libs_installer = os.getenv('OPENVINO_LIB_PATHS')

[2022-01-13T02:32:51.456Z]         if openvino_libs_installer:

[2022-01-13T02:32:51.456Z]             openvino_libs.extend(openvino_libs_installer.split(';'))

[2022-01-13T02:32:51.456Z]         for lib in openvino_libs:

[2022-01-13T02:32:51.456Z]             lib_path = os.path.join(os.path.dirname(__file__), lib)

[2022-01-13T02:32:51.456Z]             if os.path.isdir(lib_path):

[2022-01-13T02:32:51.456Z]                 # On Windows, with Python >= 3.8, DLLs are no longer imported from the PATH.

[2022-01-13T02:32:51.456Z]                 if (3, 8) <= sys.version_info:

[2022-01-13T02:32:51.456Z]                     os.add_dll_directory(os.path.abspath(lib_path))

[2022-01-13T02:32:51.456Z]                 else:

[2022-01-13T02:32:51.456Z]                     os.environ['PATH'] = os.path.abspath(lib_path) + ';' + os.environ['PATH']

[2022-01-13T02:32:51.456Z]     

[2022-01-13T02:32:51.456Z] >   from .ie_api import *

[2022-01-13T02:32:51.456Z] E   ImportError: libpython3.7m.so.1.0: cannot open shared object file: No such file or directory

[2022-01-13T02:32:51.456Z] 

[2022-01-13T02:32:51.456Z] ../conda/lib/python3.7/site-packages/openvino/inference_engine/__init__.py:30: ImportError

Reproduction

  1. What command or script did you run?
A placeholder for the command.
  1. Did you make any modifications on the code or config? Did you understand what you have modified?

Environment

[2022-01-13T02:18:21.531Z] 2022-01-13 10:18:21,435 - mmdeploy - INFO - TorchVision: 0.10.0

[2022-01-13T02:18:21.531Z] 2022-01-13 10:18:21,435 - mmdeploy - INFO - OpenCV: 4.5.4

[2022-01-13T02:18:21.531Z] 2022-01-13 10:18:21,435 - mmdeploy - INFO - MMCV: 1.4.0

[2022-01-13T02:18:21.531Z] 2022-01-13 10:18:21,435 - mmdeploy - INFO - MMCV Compiler: GCC 7.5

[2022-01-13T02:18:21.531Z] 2022-01-13 10:18:21,435 - mmdeploy - INFO - MMCV CUDA Compiler: 11.1

[2022-01-13T02:18:21.531Z] 2022-01-13 10:18:21,435 - mmdeploy - INFO - MMDeployment: 0.1.0+76f96f0

[2022-01-13T02:18:22.109Z] 2022-01-13 10:18:21,804 - mmdeploy - INFO - onnxruntime: 1.10.0 ops_is_avaliable : True

[2022-01-13T02:18:22.109Z] 2022-01-13 10:18:21,916 - mmdeploy - INFO - tensorrt: 8.0.3.4 ops_is_avaliable : False

[2022-01-13T02:18:22.109Z] 2022-01-13 10:18:21,920 - mmdeploy - INFO - ncnn: None ops_is_avaliable : False

[2022-01-13T02:18:22.109Z] 2022-01-13 10:18:21,922 - mmdeploy - INFO - pplnn_is_avaliable: False

[2022-01-13T02:18:22.109Z] 2022-01-13 10:18:21,924 - mmdeploy - INFO - openvino_is_avaliable: True

Error traceback

If applicable, paste the error trackback here.

A placeholder for trackback.

Bug fix

If you have already identified the reason, you can provide the information here. If you are willing to create a PR to fix it, please also leave a comment here and that would be much appreciated!

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions