HobbitLong / CMC

[arXiv 2019] "Contrastive Multiview Coding", also contains implementations for MoCo and InstDis
BSD 2-Clause "Simplified" License
1.3k stars 179 forks source link

Weight shape in Linear classifier #52

Closed bfshi closed 4 years ago

bfshi commented 4 years ago

Hi! Congrats on the work!

I may find something weird here.

https://github.com/HobbitLong/CMC/blob/58d06e9a82f7fea2e4af0a251726e9c6bf67c7c9/models/LinearModel.py#L82

nChannels here should be 512 width instead of 2048 width? For example, for ResNet18v1, each view has 256 channel, so that's 512 in total

HobbitLong commented 4 years ago

Hi, @bfshi, good catch! This should only work for ResNet-50. Please adapt it to 512 if you wanna use ResNet18.