question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Plugin fails when trying YOLOv4-tiny model

See original GitHub issue

Hey Alexis. Thank you for the great work.

I tried to run YOLOv4-tiny-416 model using an ONNX file converted using https://github.com/jkjung-avt/tensorrt_demos/blob/master/yolo/yolo_to_onnx.py.

However, the engine is not built, since an assertion in the YOLO layer plugin fails. python: yolo_layer.cu:115: virtual nvinfer1::Dims nvinfer1::YoloLayerPlugin::getOutputDimensions(int, const nvinfer1::Dims*, int): Assertion `inputs[0].d[0] == (mNumClasses + 5) * mNumAnchors' failed.

This is the class that I have added to yolo.py

class YOLOv4_tiny(YOLO):
    ENGINE_PATH = Path(__file__).parent / 'yolov4-tiny-416.trt'
    MODEL_PATH = Path(__file__).parent /  'yolov4-tiny-416.onnx'
    NUM_CLASSES = 90
    INPUT_SHAPE = (3, 416, 416)
    LAYER_FACTORS = [32, 16]
    SCALES = [1.05, 1.05]
    ANCHORS = [[81,82,  135,169,  344,319],
              [10,14,  23,27,  37,58]]

Could you please help me debug this?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
PiyalGeorgecommented, Dec 11, 2020

@GeekAlexis Thanks a lot. Will try that.

I tried your repo in Xavier-NX. It works like charm with Good FPS and accuracy! Good job

0reactions
GeekAlexiscommented, Dec 11, 2020

@PiyalGeorge Yes, you need to train a ReID model on the same class, assuming the class is not person. And there is nothing specific for tiny because ReID is independent of detector. FYI, you shouldn’t convert YOLO to TensorRT, converting to ONNX is enough.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Problems converting yolov4-tiny-3layer models to TRT #334
Hello JK, I am trying to convert a custom-trained yolov4-tiny-3layer model to tensorRT to do accelerated inference on the Jetson Nano.
Read more >
DeepStream 4.0 + Custom Yolo Model - App run failed
I have a custom Yolo model build upon yolov3-tiny. ... Deserialize yoloLayerV3 plugin: yolo_31 ** ERROR: <main:651>: Failed to set pipeline ...
Read more >
Using YOLOv4 on NVIDIA DeepStream 5.0 - Medium
This article will guide you to install and use Yolo-v4 on NVIDIA DeepStream 5.0. ... Try to give explicit path /usr/src/tensorrt/bin/trtexec ...
Read more >
Solved: Re: Help converting owned YOLOv4-tiny model to IR
When I ran it, it threw the following error: ... I am attaching the three Yolov4-tiny model files in a compressed zip file,...
Read more >
Tutorial Darknet* YOLOv4 Model - OpenVINO™ Documentation
Since the model is not supported directly in the OpenVINO and the DL Workbench, according to the model import recommendations, you need to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found