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

Problem in training #4

Open
Johumliu opened this issue Feb 5, 2020 · 1 comment
Open

Problem in training #4

Johumliu opened this issue Feb 5, 2020 · 1 comment

Comments

@Johumliu
Copy link

Johumliu commented Feb 5, 2020

[ep 1][it 80][loss 0.0043][lr 1.0000][0.71s]
[cnt: gt: 155.0 pred: 0.03]
[ep 1][it 90][loss 0.0047][lr 1.0000][0.72s]
[cnt: gt: 10.0 pred: 0.29]
Traceback (most recent call last):
File "train.py", line 33, in
cc_trainer.forward()
File "/root/ljh/NWPU-Crowd-Sample-Code/trainer.py", line 63, in forward
self.train()
File "/root/ljh/NWPU-Crowd-Sample-Code/trainer.py", line 82, in train
for i, data in enumerate(self.train_loader, 0):
File "/usr/local/lib/python3.6/dist-packages/torch/utils/data/dataloader.py", line 310, in next
data = self.dataset_fetcher.fetch(index) # may raise StopIteration
File "/usr/local/lib/python3.6/dist-packages/torch/utils/data/utils/fetch.py", line 44, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/usr/local/lib/python3.6/dist-packages/torch/utils/data/utils/fetch.py", line 44, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/root/ljh/NWPU-Crowd-Sample-Code/datasets/basedataset.py", line 57, in getitem
img = self.img_transform(img)
File "/usr/local/lib/python3.6/dist-packages/torchvision/transforms/transforms.py", line 61, in call
img = t(img)
File "/usr/local/lib/python3.6/dist-packages/torchvision/transforms/transforms.py", line 166, in call
return F.normalize(tensor, self.mean, self.std, self.inplace)
File "/usr/local/lib/python3.6/dist-packages/torchvision/transforms/functional.py", line 217, in normalize
tensor.sub
(mean[:, None, None]).div
(std[:, None, None])
RuntimeError: The size of tensor a (4) must match the size of tensor b (3) at non-singleton dimension 0

@gjy3035
Copy link
Owner

gjy3035 commented Feb 8, 2020

Is this error re-produced?

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