Hello Members,

i want to convert a costum OpenVino Model. The .xml and. bin Files converted with Ultralytix.
The OpenVino Model is running (original its a Yolov8n PyTorch model)
But when I start the Converter on: http://blobconverter.luxonis.com

Error:Cannot create Interpolate layer /model.10/Resize id:164 from unsupported opset: opset11

  • jakaskerl replied to this.
  • I was able to convert it to blob by converting PyTorch to Onnx and then to .blob

    import torch

    from ultralytics import YOLO

    # Load your YOLO model

    model = YOLO('yolov8n.pt')

    # Convert PyTorch model to ONNX

    dummy_input = torch.randn(1, 3, 640, 640)

    torch.onnx.export(model.model, dummy_input, "yolov8n.onnx", verbose=True, opset_version=10) #Changed the #Opset to 10

    Hi keggy
    Could you try using a different OpenVINO version; maybe a 2021.4? Changing to different opset might also help.

    Hope it works.

    Thanks,
    Jaka

    I was able to convert it to blob by converting PyTorch to Onnx and then to .blob

    import torch

    from ultralytics import YOLO

    # Load your YOLO model

    model = YOLO('yolov8n.pt')

    # Convert PyTorch model to ONNX

    dummy_input = torch.randn(1, 3, 640, 640)

    torch.onnx.export(model.model, dummy_input, "yolov8n.onnx", verbose=True, opset_version=10) #Changed the #Opset to 10

    But as I see I need a .json file for the Yolov8 to run on the camera?

    Is there any smallest example just to run the .blob file on the camera with color image?

      Hi keggy
      Not needed as far as I know. If you already have the blob, there is no need to use the json. Depends on whether you are using SDK or API.
      For api:
      detectionNetwork.setBlobPath(<blob path>)

      For sdk:
      nn = oak.create_nn('path_to_blob', color)

      According to the definition, both .json and .blob can be passed.

      def _parse_model(self, model):
              """
              Called when NNComponent is initialized. Parses "model" argument passed by user.
              """
              if isinstance(model, Dict):
                  self._parse_config(model)
                  return
              # Parse the input config/model
              elif isinstance(model, str):
                  # Download from the web, or convert to Path
                  model = getBlob(model) if isUrl(model) else Path(model)
      
              if model.suffix in ['.blob', '.json']:
                  if model.suffix == '.blob':
                      self._blob = dai.OpenVINO.Blob(model.resolve())
                      self._forced_version = self._blob.version
                  elif model.suffix == '.json':  # json config file was passed
                      self._parse_config(model)

      Thanks,
      Jaka

      Hey @jakaskerl thanks for the reply. I think my error is that I don't know the Anchormasks:
      Mask is not defined for output layer with width '8400'. Define at pipeline build time using: 'setAnchorMasks' for 'side8400'

      But I think I will get them today so I will try out with it.

      best regards

      David