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

The dimension is wrong #2

Open
qingchenkanlu opened this issue Aug 4, 2021 · 3 comments
Open

The dimension is wrong #2

qingchenkanlu opened this issue Aug 4, 2021 · 3 comments

Comments

@qingchenkanlu
Copy link

Traceback (most recent call last):
File "main.py", line 105, in
main(opt)
File "main.py", line 70, in main
log_dict_train, _ = trainer.train(epoch, train_loader)
File "/home/yusheng/code/GraspKpNet-main/src/lib/trains/base_trainer.py", line 126, in train
return self.run_epoch('train', epoch, data_loader)
File "/home/yusheng/code/GraspKpNet-main/src/lib/trains/base_trainer.py", line 74, in run_epoch
output, loss, loss_stats = model_with_loss(batch)
File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 477, in call
result = self.forward(*input, **kwargs)
File "/home/yusheng/code/GraspKpNet-main/src/lib/trains/base_trainer.py", line 20, in forward
loss, loss_stats = self.loss(outputs, batch)
File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 477, in call
result = self.forward(*input, **kwargs)
File "/home/yusheng/code/GraspKpNet-main/src/lib/trains/dbmctdet.py", line 68, in forward
lm_focal_loss = self.crit(output['lm'], batch['lm']) / opt.num_stacks
File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 477, in call
result = self.forward(*input, **kwargs)
File "/home/yusheng/code/GraspKpNet-main/src/lib/models/losses.py", line 284, in forward
return self.neg_loss(out, target)
File "/home/yusheng/code/GraspKpNet-main/src/lib/models/losses.py", line 166, in _neg_loss
pos_loss = torch.log(pred) * torch.pow(1 - pred, 2) * pos_inds
RuntimeError: The size of tensor a (128) must match the size of tensor b (64) at non-singleton dimension 3

@qingchenkanlu qingchenkanlu changed the title 大佬,这维数不对啊 The dimension is wrong Aug 7, 2021
@ruinianxu
Copy link
Collaborator

Sorry for the late reply. I just corrected some bugs. The previous model was used for internal use. Please let me know if everything is ok right now.

@qingchenkanlu
Copy link
Author

OK, I will have a try. One more question, when I train the network based on the Cornell dataset, the network seems overfitting, but when I train the network on the AJD, that is not happend. Is there any tricks?

@ruinianxu
Copy link
Collaborator

I think the main reason is that the original Cornell dataset is too small and even after augmentation, its variation is still limited. For prevent overfitting, I think early termination will help. I tried decreasing lr but it didn't help a lot.

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

2 participants