Yolov4 error when trying to display image on custom model

user14968775

I have trained my own model, using my own custom dataset, using Yolov4, and I have downloaded the .cfg, .weights and .data files.

When I try to run my model using:

darknet.exe detector test cfg/obj.data cfg/yolov4-og.cfg custom-yolov4-detector_best.weights 

I get the error:

Error: l.outputs == params.inputs filters= in the [convolutional]-layer doesn't correspond to classes= or mask= in [yolo]-layer 

I don't know if this is an error on my part, with the command I am running, or an error from the model I trained.

Any help would be appreciated.

A. Parico

I am assuming you are using the main darknet repo AlexeyAB. Please make sure you follow the following instructions:

  1. Make sure you assign the correct classes number in the config file.

  2. Change filters=255 to filters=(classes + 5)x3 in the 3 [convolutional] before each [yolo] layer, keep in mind that it only has to be the last [convolutional] before each of the [yolo] layers

    https://github.com/AlexeyAB/darknet/blob/0039fd26786ab5f71d5af725fc18b3f521e7acfd/cfg/yolov3.cfg#L603 https://github.com/AlexeyAB/darknet/blob/0039fd26786ab5f71d5af725fc18b3f521e7acfd/cfg/yolov3.cfg#L689 https://github.com/AlexeyAB/darknet/blob/0039fd26786ab5f71d5af725fc18b3f521e7acfd/cfg/yolov3.cfg#L776

    So if classes=1 then should be filters=18. If classes=2 then write filters=21

    (Generally filters depends on the classes, coords and number of masks, i.e. filters=(classes + coords + 1)*, where mask is indices of anchors. If mask is absent, then filters=(classes + coords + 1)*num)

Reference: https://github.com/AlexeyAB/darknet#how-to-train-to-detect-your-custom-objects

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Error when trying to display image in tkinter canvas

YOLOv4 custom model: is final.weights or last.weights better?

Error 404 when trying to display images from custom folder in Wordpress

Value error on Image field when trying to comvert model to dict

utf-8 decode error when trying to feed an image into a model

Error when trying to display an image saved in a computer file

Step size in YOLOv4 Model

Error when trying to Scaffold a model

Python Wand error when trying to display simple empty image: 'no encode delegate for this image format'

UnicodeDecodeError: when trying to save image to the django model

My custom dropdown widget throws an error when trying to set an initial value for it using a model instance

"Error '424' Object required" when trying to display "Temp.jpg" in an Image Box (imgRpts1)

What all these parameters means in yoloV4 model

KerasClassifier error when trying to run a LST Model

Error when trying to create tables from model

Error when trying to export randomForest model to PMML

Error when trying to display a timer into button text

Getting error when trying to display button

Error when trying to display page in JSON format

Error when trying to display the number of pages in PdfKit

parse error when trying to display in laravel view

Getting an error when trying to display images

Display custom overlay image when button is pushed

Error when trying to create/update a custom form

Yolov4 tiny and Darknet and Colab results in error

Error when trying to save a captured image in swift

Getting error when trying to resize an inserted image

Segmentation error when trying to equalize an image

Error In Multer When Trying To Upload A Image