I have followed this link to train yolo with my own dataset. I'm not using the CIAFR10 data. https://pjreddie.com/darknet/train-cifar/
This is the cfg file named as cifar.cfg
[net]
batch=128
subdivisions=1
height=28
width=28
channels=3
max_crop=32
min_crop=32
hue=.1
saturation=.75
exposure=.75
learning_rate=0.001
policy=poly
power=4
max_batches =1000
momentum=0.9
decay=0.0005
[convolutional]
batch_normalize=1
filters=32
size=3
stride=1
pad=1
activation=leaky
[maxpool]
size=2
stride=2
[convolutional]
batch_normalize=1
filters=64
size=3
stride=1
pad=1
activation=leaky
[maxpool]
size=2
stride=2
[convolutional]
batch_normalize=1
filters=128
size=3
stride=1
pad=1
activation=leaky
[convolutional]
filters=4
size=1
stride=1
pad=1
activation=leaky
[avgpool]
[softmax]
groups=1
[cost]
type=sse
It classifies the test images on Ubuntu 16.04 properly. I have used this cgf file and corresponding wights in the OpenCV3.4 DNN module. I'm using the Visual studio 2017.
String modelFile = "cifar_small.cfg";
String modelBinary = "cifar_small.weights";
When the line below is executed, I get the error message:
dnn::Net net = readNetFromDarknet(modelFile,modelBinary);
Error message: OpenCV Error: Parsing error (Unknown layer type: avgpool) in `cv::dnn::darknet::ReadDarknetFromCfgFile, file C:\build\master_winpack-build-win64-vc14\opencv\modules\dnn\src\darknet\darknet_io.cpp, line 503
Also, for the sooftmax and see. Looks like DNN is not able to comprehend these terms. Can someone let me know how to fix these issues?
If I remove the avgpool then the classification result by net.forward() is unreadable. It is the form of 1 channel with rows and columns equal to 0. When I passed the other model from tensorflow( .pb) I get 4 probabilities for each class. Thanks