EfficientDet.Pytorch icon indicating copy to clipboard operation
EfficientDet.Pytorch copied to clipboard

How many parameters do you have?

Open HansolEom opened this issue 4 years ago • 4 comments

From what I read in the paper, the effectivedet-d0 standard was 3.9m. But your model comes in 10.2m on a d0 basis. Did I calculate the parameters correctly?

model = EfficientDet(num_classes=args.num_class,
                     network=args.network,
                     W_bifpn=EFFICIENTDET[args.network]['W_bifpn'],
                     D_bifpn=EFFICIENTDET[args.network]['D_bifpn'],
                     D_class=EFFICIENTDET[args.network]['D_class']
                     )

def count_parameters(model):
    return sum(p.numel() for p in model.parameters() if p.requires_grad)
print (count_parameters(model))

python train.py --dataset COCO --dataset_root ~/data/coco/ --network efficientdet-d0 --batch_size 32

Loaded pretrained weights for efficientnet-b0 10261154

HansolEom avatar Jan 31 '20 00:01 HansolEom

my model has 57.1m parameters on a d0 basis with 1601 classes and 401 attributes

y78h11b09 avatar Jan 31 '20 03:01 y78h11b09

dataset VG , network efficientdet-d0, batch_size 2

y78h11b09 avatar Jan 31 '20 03:01 y78h11b09

The paper has provided a deceptive number. If you manually calculate the total number of trainable parameters for d0, it is 10.2 Million parameters (backbone + biFpn + heads).

The paper has only provided the parameters (3.9M) for biFpn + heads.

The paper doesn't mention this explicitly.

dvlshah avatar Feb 02 '20 06:02 dvlshah

@dvlshah That is actually incorrect. See my newer issue on convolutions where I found that the paper is including the backbone (minus the classifier layer) and bifpn+ heads in its parameter calculations but that the convolutions in the bifpn+heads need to be depthwise separable (as explicitly stated in the paper for bifpn and implied heads) and you need to properly set Dclass and WClass which are set incorrectly in the current code.

rmcavoy avatar Mar 09 '20 16:03 rmcavoy