deep-person-reid icon indicating copy to clipboard operation
deep-person-reid copied to clipboard

Model Size bigger than expect

Open bryanlinnan opened this issue 4 years ago • 4 comments

Hi Kaiyang, I trained mobilenetv2 which should be about 12M size, but the output model "model.pth.tar-50" is about 40M, is this normal? the output model seems to contain more than just model weights.

bryanlinnan avatar Aug 13 '20 09:08 bryanlinnan

that's a bit weird

so if you save the pure weights of mobilenetv2, it'd be around 9M

the 12M size might count the oprimizer's and scheduler's states

but anyway, which dataset are you using? I'd be curious if the large weights come from a heavy classification layer (say you have many many IDs)

KaiyangZhou avatar Aug 14 '20 14:08 KaiyangZhou

my trainset data has 575 class, i think it's not the root cause, i wonder how can i save the pure '.pth' model?

bryanlinnan avatar Aug 21 '20 02:08 bryanlinnan

what do you mean by how to save the .pth model? isn't it as simple as using torch.save?

KaiyangZhou avatar Aug 21 '20 08:08 KaiyangZhou

sorry, i thought the model size bigger than expectation is due to the model saved some other things, but it seems nothing else after i checked the code, so the question is still why the model size is such big? 500 classes will cause this?

bryanlinnan avatar Aug 24 '20 01:08 bryanlinnan