-
Notifications
You must be signed in to change notification settings - Fork 0
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
RuntimeError: The size of tensor a (639) must match the size of tensor b (319) at non-singleton dimension 3 #3
Comments
Sorry, I leaved some debug codes leading to this error. I pushed a new version, please pull the latest code. |
My dear brother, the tensor match error problem cannot be solved after using new code. I want to ask whether it is a code problem or a dependent library version problem? |
Please pull the latest and try again. I have tested the current code by myself, it can work now. |
I previously met the same problem. I found that the output scale w.r.t. the inputs size is [2,1,1/2,1/4,1/8], the depth result just downsample the first one to scale=1, so when computing losses, the second scale is not aligned with the color image. I tried another way before this commit by myself that downsampling all disps with |
@SheffieldCao Thank you for your answer. Your solution is also right. |
Thank you very much, dear brother. You can be an academician in the future. |
@SheffieldCao You are so awesome. Thank you for the solution. I really want to go to Tongji University. |
Hello, thank you for your excellent work. The code always displays tensor mismatch when running monocular training. Can you help me to provide some solutions? Thank you very much.
The error message is as follows:
Traceback (most recent call last):
File "train.py", line 18, in
trainer.train()
File "/home/yzhang/BRNet/trainer.py", line 189, in train
self.run_epoch()
File "/home/yzhang/BRNet/trainer.py", line 205, in run_epoch
outputs, losses = self.process_batch(inputs)
File "/home/yzhang/BRNet/trainer.py", line 260, in process_batch
losses = self.compute_losses(inputs, outputs)
File "/home/yzhang/BRNet/trainer.py", line 492, in compute_losses
smooth_loss = get_smooth_loss(norm_disp, color)
File "/home/yzhang/BRNet/layers.py", line 214, in get_smooth_loss
grad_disp_x *= torch.exp(-grad_img_x)
RuntimeError: The size of tensor a (639) must match the size of tensor b (319) at non-singleton dimension 3
The text was updated successfully, but these errors were encountered: