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

About train problem #8

Open
zyz-notebooks opened this issue Sep 9, 2020 · 1 comment
Open

About train problem #8

zyz-notebooks opened this issue Sep 9, 2020 · 1 comment

Comments

@zyz-notebooks
Copy link

When I was training, the following problems occurred in the middle of my training.
looking forward to your reply.

2020-09-08 09:50:59.346583 Iter: 2880 Loss: 0.171822
Wait until the dataprocesses to end
Traceback (most recent call last):
File "main.py", line 121, in
main()
File "main.py", line 111, in main
train_net()
File "/home/zyz/Project/3D-R2N2-PyTorch/lib/train_net.py", line 24, in func_wrapper
return func(*args, **kwargs)
File "/home/zyz/Project/3D-R2N2-PyTorch/lib/train_net.py", line 84, in train_net
solver.train(train_loader, val_loader)
File "/home/zyz/Project/3D-R2N2-PyTorch/lib/solver.py", line 117, in train
loss = self.train_loss(batch_img, batch_voxel)
File "/home/zyz/Project/3D-R2N2-PyTorch/lib/solver.py", line 65, in train_loss
loss = self.net(x, y, test=False)
File "/home/zyz/anaconda3/envs/3D-R2N2/lib/python3.6/site-packages/torch/nn/modules/module.py", line 532, in call
result = self.forward(*input, **kwargs)
File "/home/zyz/Project/3D-R2N2-PyTorch/models/base_gru_net.py", line 76, in forward
gru_out, update_gate = self.encoder(x[time], h, u, time)
File "/home/zyz/anaconda3/envs/3D-R2N2/lib/python3.6/site-packages/torch/nn/modules/module.py", line 532, in call
result = self.forward(*input, **kwargs)
File "/home/zyz/Project/3D-R2N2-PyTorch/models/res_gru_net.py", line 155, in forward
t_x_s_update = self.t_x_s_update(rect7, h)
File "/home/zyz/anaconda3/envs/3D-R2N2/lib/python3.6/site-packages/torch/nn/modules/module.py", line 532, in call
result = self.forward(*input, **kwargs)
File "/home/zyz/Project/3D-R2N2-PyTorch/lib/layers.py", line 45, in forward
out = self.fc_layer(fc7).view(*target_shape) + self.conv3d(h) + self.bias
RuntimeError: The size of tensor a (5) must match the size of tensor b (12) at non-singleton dimension 0

@Wszzn
Copy link

Wszzn commented Aug 18, 2024

I have met the same problem and later I solve with it.
You only need to add "drop_last=True" to the data_loader.
I hope it will be helpful.
Thank u.

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