CenterNet icon indicating copy to clipboard operation
CenterNet copied to clipboard

RuntimeError while running CenterNet on visdrone training set on ctdet task CUDA9.0 pytorch 1.1.0

Open cnr0724 opened this issue 5 years ago • 1 comments

When I try to train CenterNet, I get the error like this.

File "main.py" line 102, in main(opt) File "main.py", line 70, in main log_dict_train, _ = trainer.train(epoch, train_loader) File "/root/CenterNet/src/lib/trains/base_trainer.py", line 119, in train return self.run_epoch('train', epoch, data_loader) File "/root/CenterNet/src/lib/trains/base_trainer.py", line 69, in run_epoch output,loss,loss_stats = model_with_loss(batch) File "/root/anaconda3/envs/CenterNet/lib/python3.6/site-packages/torch/nn/modules/module.py" , line 493, in call result = self.forward(*input, **kwargs) File "/root/CenterNet/src/lib/trains/base_trainer.py", line 19, in forward outputs= self.model(batch['input']) File "/root/anaconda3/envs/CenterNet/lib/python3.6/site-packages/torch/nn/modules/module.py" , line 493, in call result = self.forward(*input, **kwargs) File "/root/CenterNet/src/lib/models/networks/pose_dla_dcn.py", line 474, in forward x = self.base(x) File "/root/anaconda3/envs/CenterNet/lib/python3.6/site-packages/torch/nn/modules/module.py" , line 493, in call result = self.forward(*input, **kwargs) File "/root/CenterNet/src/lib/models/networks/pose_dla_dcn.py", line 293, in forward x = getattr(self, 'level{}'.format(i))(x) File "/root/anaconda3/envs/CenterNet/lib/python3.6/site-packages/torch/nn/modules/module.py" , line 493, in call result = self.forward(*input, **kwargs) File "/root/CenterNet/src/lib/models/networks/pose_dla_dcn.py",line 217, in forward x1 = self.tree1(x, residual) File "/root/anaconda3/envs/CenterNet/lib/python3.6/site-packages/torch/nn/modules/module.py" , line 493, in call result = self.forward(*input, **kwargs) File "/root/CenterNet/src/lib/models/networks/pose_dla_dcn.py",line 217, in forward x1 = self.tree1(x, residual) File "/root/anaconda3/envs/CenterNet/lib/python3.6/site-packages/torch/nn/modules/module.py" , line 493, in call result = self.forward(*input, **kwargs) File "/root/CenterNet/src/lib/models/networks/pose_dla_dcn.py", line 59, in forward out += residual RuntimeError: The size of tensor a (68) must match the size of tensor b (67) at non-singleton dimension 3

I tried to reshape the tensor to solve the runtimeError but it didn't work. (Another error telling that the shapes of the out tensor and the residual tensor are different occured.) What should I do in order to make it work?

cnr0724 avatar Mar 11 '21 04:03 cnr0724

How do you fix this issue?

idantony avatar Dec 06 '21 14:12 idantony