Darknet: How can I train Imagenet dataset with alexnet in darknet?

Created on 21 May 2020  路  9Comments  路  Source: AlexeyAB/darknet

Hi,
I'm trying to train classifier alexnet with imagenet dataset,
but I don't know how to prepare imagenet dataset.
Is there anyone who trained alexnet with imagenet dataset, can help me?

In imagenet dataset,
there are train, test, val in Data (each images in here (like /n01440764/n01440764_31.JPEG ))
and I don't know what are test.txt, train_loc.txt, train_cls.txt, val.txt mean.

So, what do I have to edit imagenet1k.data, imagenet1k.train.list, imagenet1k.val.list

All 9 comments

https://pjreddie.com/darknet/imagenet/

Thnk you but, this is pre-trained model. I want to train my own alexnet weight.

https://github.com/AlexeyAB/darknet/blob/master/scripts/get_imagenet_train.sh

I already set my data, train.list, labels, shotnames.
This is my imagenet dataset structure

ILSVRC
ILSVRC/Annotations/CLS-LOC/train (include xml files)
LSVRC/Annotations/CLS-LOC/val (include xml files)
ILSVRC/Data/CLS-LOC/test (include JPEG files name ILSVRC2012_.JPEG)
ILSVRC/Data/CLS-LOC/train (include 1000 folders that each name is imagenet class name and folders are containing classname_number.JPEG)
ILSVRC/Data/CLS-LOC/val (include JPEG files name ILSVRC2012_
.JPEG)
ILSVRC/ImageSets/CLS-LOC/test.txt
ILSVRC/ImageSets/CLS-LOC/train_cls.txt
ILSVRC/ImageSets/CLS-LOC/train_loc.txt
ILSVRC/ImageSets/CLS-LOC/val.txt

I already made train.list by each directory of ILSVRC/Data/CLS-LOC/train/classname folder/classname_number.JPEG
But, I can't train alexnet with this. When I input command ./darknet classifier train ~~~ , train looks like in progress, but avg loss keep in same point until 220000 batches. But when I tried with cifar.cfg it seems no problem. Do I have to change alexnet.cfg through my dataset?

https://github.com/AlexeyAB/darknet/blob/master/scripts/get_imagenet_train.sh#L16
imagenet1k.train.list is your train list.

and remove [cost] layer.

I know imagenet1k.train.list is my train list. And I already modify imagenet1k.train.list with my train JPEG images directory. And now I removed cost layer and training but I cannot find any different with before removed it.

when I train for almost 32 hours, avg loss is same like this.

average loss (id:976883166)

At now, I removed [cost] layer in alexnet it seems like doing well, but I have to check it tomorrow. Thank you for helping

I checked again now. It work well! Thanks alot!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hemp110 picture hemp110  路  3Comments

HilmiK picture HilmiK  路  3Comments

Greta-A picture Greta-A  路  3Comments

jasleen137 picture jasleen137  路  3Comments

qianyunw picture qianyunw  路  3Comments