You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using distiller where teacher network is resnet34.
I am getting this error while training the model:
distiller(data, target)
Traceback (most recent call last):
File "/home/neel/miniconda3/envs/process/lib/python3.7/code.py", line 90, in runcode
exec(code, self.locals)
File "", line 1, in
File "/home/neel/miniconda3/envs/process/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1130, in _call_impl
return forward_call(*input, **kwargs)
File "/home/neel/miniconda3/envs/process/lib/python3.7/site-packages/vit_pytorch/distill.py", line 146, in forward
reduction = 'batchmean')
File "/home/neel/miniconda3/envs/process/lib/python3.7/site-packages/torch/nn/functional.py", line 2916, in kl_div
reduced = torch.kl_div(input, target, reduction_enum, log_target=log_target)
RuntimeError: The size of tensor a (1000) must match the size of tensor b (2) at non-singleton dimension 1
the shape of my data is:
torch.Size([24, 3, 224, 224])
the shape of the target is :
torch.Size([24])
Is there something wrong? I am using the same instructions from the GitHub homepage. Has anyone else experienced this?
Neel
The text was updated successfully, but these errors were encountered:
Hi,
I am using distiller where teacher network is resnet34.
I am getting this error while training the model:
distiller(data, target)
Traceback (most recent call last):
File "/home/neel/miniconda3/envs/process/lib/python3.7/code.py", line 90, in runcode
exec(code, self.locals)
File "", line 1, in
File "/home/neel/miniconda3/envs/process/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1130, in _call_impl
return forward_call(*input, **kwargs)
File "/home/neel/miniconda3/envs/process/lib/python3.7/site-packages/vit_pytorch/distill.py", line 146, in forward
reduction = 'batchmean')
File "/home/neel/miniconda3/envs/process/lib/python3.7/site-packages/torch/nn/functional.py", line 2916, in kl_div
reduced = torch.kl_div(input, target, reduction_enum, log_target=log_target)
RuntimeError: The size of tensor a (1000) must match the size of tensor b (2) at non-singleton dimension 1
the shape of my data is:
torch.Size([24, 3, 224, 224])
the shape of the target is :
torch.Size([24])
Is there something wrong? I am using the same instructions from the GitHub homepage. Has anyone else experienced this?
Neel
The text was updated successfully, but these errors were encountered: