Closed groot-1313 closed 6 years ago
What is the type of network do you try to use, is your network based on Semantic Segmentation network?
I am using the densely connected neural network as the base network. It worked well to give an object segmentation output upon removing the fully connected layers and placing a sigmoid activation function on the final convolution layer. I want to use this network to also predict bounding boxes without having to take the sliding window approach for multiple objects within an image. But I observed darknet doesn't have a sigmoid layer, but only a softmax layer. Thanks for the quick reply!!
Also you can try to use DSOD model (DenseNet + SSD) https://arxiv.org/abs/1708.01241v1
Or you can try to train densenet201_yolo.cfg
using command darknet.exe detector train data/obj.data densenet201_yolo.cfg densenet201.300
https://github.com/AlexeyAB/darknet/blob/master/build/darknet/x64/densenet201_yolo.cfg
densenet201.300
by using command line darknet.exe partial cfg/densenet201.cfg densenet201.weights densenet201.300 300
densenet201.weights
can be downloaded: https://pjreddie.com/media/files/densenet201.weightsOh thanks for the input! Will look into DSOD.
I actually wanted to use densenet201.cfg but I could not find the appropriate pretrained file. Thanks for pointing that out!
Are the deconvolutional layers not supported? networks.c
has it defined and upon checking deconvolutional_layer.c
has the same fields as the convolutional layer. This error did not show in the original repository.
[deconvolutional]
filters=1
size=3
stride=2
activation=linear
Gives me the following error:
Type not recognized: [deconvolutional] Unused field: 'filters = 1' Unused field: 'size = 3' Unused field: 'stride = 2' Unused field: 'activation = linear'
I am also getting nan values upon using densenet201_yolo.cfg with densenet201.300
batch=128
subdivisions=4
burn_in=1000
stopbackward=1
and train https://github.com/AlexeyAB/darknet/blob/a1af57d8d60b50e8188f36b7f74752c8cc124177/build/darknet/x64/densenet201_yolo.cfg#L1938I got NAN on all iteration number lines.
I got the first NAN on the first iteration.
I will try it upon changing batch
and subdivision
values. Can you please shed some light upon the cause of such values?
I could give stopbackward=1
an attempt because YOLO network as it is gave better results with the pretrained weights than it did after training for 50k iterations.
@groot-1313 If you're attempting transfer learning, you can try with even smaller learning rate. I've experienced similar issue when my learning rate was high (in the order ^-2 or sometime with ^-3). Usually occurs when the gradients are too big.
I changed the learning rate to order of ^-3 from ^-2 after 40k iterations. Continued training for 30k iterations more, but saw no improvement. The performance of the network actually deteriorated in comparison to the weights after 8k iterations.
The performance of the network actually deteriorated in comparison to the weights after 8k iterations.
Appears to be overfitting. You can try adding dropouts.
@sivagnanamn , it is not really over fitting because it performs poorly on the training data as well!
hi @AlexeyAB, finetuning the network worked out well, better than any of my previous attempts. Though I am still not highly satisfied with the model. Could be due to 2 reasons.
Any more suggestions to improve the learning?
@groot-1313 Hi,
What mAP and IoU can you get using densenet201_yolo.cfg
and using previous model that was based on yolo-voc.2.0.cfg
or other? darknet.exe detector map data/obj.data yolo-obj.cfg backup\yolo-obj_22000.weights
What is the complexity of your data? Are there small objects (you can set small_object=1
in the region-layer)? Or are there a lot of them (set max=200
in the region-layer)? https://github.com/AlexeyAB/darknet#how-to-improve-object-detection
You can try to remove stopbackward=1
and move it to this line - so that the fine-tuning affects more layers. Move it to the 1-st route-layer after the last maxpool-layer: https://github.com/AlexeyAB/darknet/blob/a1af57d8d60b50e8188f36b7f74752c8cc124177/build/darknet/x64/densenet201_yolo.cfg#L1349
Also try to set:
angle=0
saturation = 1.5
exposure = 1.5
hue=.1
learning_rate=0.0001 max_batches = 45000 policy=steps steps=100,25000,35000 scales=10,.1,.1
* Also if you have small objects, you can try to increase `width=608 height=608` or try to use `random=1` if you have enought GPU-RAM (if error out-of-memory occurs, then try to increase subdivision=64)
@AlexeyAB , I will try with the suggestions you have mentioned. I do have small objects, so setting small_object=1
should definitely help.
I was also wondering if its possible to visualize the outputs of the intermediate layers, for example , I would like to visualize the output of say, the 13th convolutional layer.
i tried to used resnet50 as cnn in yolo2, but bbox_loss becomes to nan. with smaller learning rate, loss becomes nan after more epochs. i tested with 1e-3, 1e-5, 1e-6 with 200k iteration. i tried with vgg16, it worked. what things need to change to finetune resnet? thanks!
@txdat
Did you use this command for training?
darknet.exe detector train data/obj.data resnet50_obj.cfg resnet50.65
To fine-tune just un-comment this line (remove #): https://github.com/AlexeyAB/darknet/blob/726cebd3fb67d65ec6d2d49fa6bfba4c053085df/build/darknet/x64/resnet50_yolo.cfg#L482
@groot-1313 Any updates on that so far?
I have modified the cfg file to have a custom base network, followed by the last convolution layer(with linear activation) and the
region
layer. My base network returns an output of the same size as the image i.e., 416.How do I change the anchor values in this respect? Is the below equation doing the right job?
anchor_val = anchor_val*32
Will this command without the
darknet19_448.conv.23
file as pretrained weights work?./darknet detector train cfg/obj.data cfg/yolo.cfg