Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NPU support on yolov8 #2398

Open
weberwcwei opened this issue Sep 17, 2024 · 3 comments
Open

NPU support on yolov8 #2398

weberwcwei opened this issue Sep 17, 2024 · 3 comments
Labels

Comments

@weberwcwei
Copy link

Describe the bug
When attempting to compile the YOLOv8 model using the NPU, a RuntimeError occurs.

---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
Cell In[8], line 7
      5 model = core.read_model(model_path)
      6 model.reshape([1, 3, 640, 640])
----> 7 compiled_model = core.compile_model(model, "NPU")

File c:\Users\Weber\Desktop\.conda\Lib\site-packages\openvino\runtime\ie_api.py:543, in Core.compile_model(self, model, device_name, config, weights)
    538     if device_name is None:
    539         return CompiledModel(
    540             super().compile_model(model, {} if config is None else config),
    541         )
    542     return CompiledModel(
--> 543         super().compile_model(model, device_name, {} if config is None else config),
    544     )
    545 else:
    546     if device_name is None:

RuntimeError: Exception from src\inference\src\cpp\core.cpp:107:
Exception from src\inference\src\dev\plugin.cpp:53:
Exception from src\plugins\intel_npu\src\plugin\src\plugin.cpp:697:
Exception from src\plugins\intel_npu\src\plugin\src\compiled_model.cpp:62:
Exception from src\plugins\intel_npu\src\compiler\src\zero_compiler_in_driver.cpp:853:
L0 pfnCreate2 result: ZE_RESULT_ERROR_INVALID_ARGUMENT, code 0x78000004

Sample code

from pathlib import Path
import openvino as ov

models_dir = Path("./model_zoo")
DET_MODEL_NAME = "yolov8n"

model_path = models_dir / f"{DET_MODEL_NAME}_openvino_model/{DET_MODEL_NAME}.xml"
core = ov.Core()
model = core.read_model(model_path)
model.reshape([1, 3, 640, 640])
compiled_model = core.compile_model(model, "NPU")

Installation instructions (Please mark the checkbox)
[X] I followed the installation guide at https://github.com/openvinotoolkit/openvino_notebooks#-installation-guide to install the notebooks.

Additional context
NPU driver version: 32.0.100.2714

@brmarkus
Copy link

Can you provide details about the platform you are using, which HW you are running on?
Which operating system do you use?
Which version of OpenVINO do you use?

When using the current version of the notebook "http://localhost:8888/lab/tree/yolov8-optimization/yolov8-object-detection.ipynb" then I still see the problem of failing compilation with like [...] from unsupported opset: opset14, as mentioned in other issues, for which workarounds exist (see e.g. "#2167 (comment)").

@avitial avitial added support_request category: NPU OpenVINO NPU plugin labels Sep 17, 2024
@weberwcwei
Copy link
Author

weberwcwei commented Sep 17, 2024

Hi @brmarkus ,

Here are the platform details:

  • OS: Windows 11
  • OpenVINO: 2024.5.0.dev20240911
  • NPU: Meteor Lake Ultra 5

Follow your mention, I tried changing the maxpool operation from opset14 to opset8 in xml, and the model compiled successfully.

I also find a similar open issue in here (openvinotoolkit/openvino#26510).

@brmarkus
Copy link

I think the dev-team is still working on this, please expect follow-up questions from them, like asking you to try a newer version or patches.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants