Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TResnet models are not working as encoder for SimCLR #91

Open
kankanar opened this issue Nov 22, 2022 · 0 comments
Open

TResnet models are not working as encoder for SimCLR #91

kankanar opened this issue Nov 22, 2022 · 0 comments

Comments

@kankanar
Copy link

I wanted to try
arch = 'tresnet_m_miil_in21k' encoder = create_encoder(arch, pretrained=True, n_in=3)
But got this error
Traceback (most recent call last): File "train_affectnet_simclr.py", line 58, in <module> model = create_simclr_model(encoder, hidden_size=2048, projection_size=128) File "/usr/local/lib/python3.7/dist-packages/self_supervised/vision/simclr.py", line 20, in create_simclr_model with torch.no_grad(): representation = encoder(torch.randn((2,n_in,128,128))) File "/usr/local/lib/python3.7/dist-packages/torch/nn/modules/module.py", line 1130, in _call_impl return forward_call(*input, **kwargs) File "/usr/local/lib/python3.7/dist-packages/timm/models/tresnet.py", line 274, in forward x = self.forward_features(x) File "/usr/local/lib/python3.7/dist-packages/timm/models/tresnet.py", line 268, in forward_features return self.body(x) File "/usr/local/lib/python3.7/dist-packages/torch/nn/modules/module.py", line 1130, in _call_impl return forward_call(*input, **kwargs) File "/usr/local/lib/python3.7/dist-packages/torch/nn/modules/container.py", line 139, in forward input = module(input) File "/usr/local/lib/python3.7/dist-packages/torch/nn/modules/module.py", line 1130, in _call_impl return forward_call(*input, **kwargs) File "/usr/local/lib/python3.7/dist-packages/torch/nn/modules/container.py", line 139, in forward input = module(input) File "/usr/local/lib/python3.7/dist-packages/torch/nn/modules/module.py", line 1130, in _call_impl return forward_call(*input, **kwargs) File "/usr/local/lib/python3.7/dist-packages/torch/nn/modules/conv.py", line 457, in forward return self._conv_forward(input, self.weight, self.bias) File "/usr/local/lib/python3.7/dist-packages/torch/nn/modules/conv.py", line 454, in _conv_forward self.padding, self.dilation, self.groups) RuntimeError: Given groups=1, weight of size [64, 48, 3, 3], expected input[2, 768, 32, 32] to have 48 channels, but got 768 channels instead

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant