wfs123456 / CCTrans

Code Reproduction
55 stars 8 forks source link

NWPU-Crowd Dataset #22

Open SarahJad opened 1 year ago

SarahJad commented 1 year ago

Hello, I tried to run the code on [NWPU-Crowd Dataset] downloaded from the following URL https://gjy3035.github.io/NWPU-Crowd-Sample-Code/ but I got this error : Traceback (most recent call last): File "/content/CCTrans/train.py", line 69, in <module> trainer.train() File "/content/CCTrans/train_helper_ALTGVT.py", line 180, in train self.train_epoch() File "/content/CCTrans/train_helper_ALTGVT.py", line 205, in train_epoch outputs, outputs_normed = self.model(inputs) File "/usr/local/lib/python3.8/dist-packages/torch/nn/modules/module.py", line 1102, in _call_impl return forward_call(*input, **kwargs) File "/content/CCTrans/Networks/ALTGVT.py", line 477, in forward x = self.forward_features(x) File "/content/CCTrans/Networks/ALTGVT.py", line 468, in forward_features x = blk(x, H, W) File "/usr/local/lib/python3.8/dist-packages/torch/nn/modules/module.py", line 1102, in _call_impl return forward_call(*input, **kwargs) File "/content/CCTrans/Networks/ALTGVT.py", line 252, in forward x = x + self.drop_path(self.attn(self.norm1(x), H, W)) File "/usr/local/lib/python3.8/dist-packages/torch/nn/modules/module.py", line 1102, in _call_impl return forward_call(*input, **kwargs) File "/content/CCTrans/Networks/ALTGVT.py", line 139, in forward x = x.reshape(B, h_group, self.ws, w_group, self.ws, C).transpose(2, 3) RuntimeError: shape '[8, 1, 8, 1, 8, 1024]' is invalid for input of size 1179648

Many thanks,

wfs123456 commented 1 year ago

For group attention,  the input size has to be divide by 256,try 256x256 or  512x512. Besides,this website https://gjy3035.github.io/NWPU-Crowd-Sample-Code/,since Gao jun  yu Doctor has graduated, the website is down for maintenance.

---Original--- From: @.> Date: Wed, Feb 22, 2023 07:18 AM To: @.>; Cc: @.***>; Subject: [wfs123456/CCTrans] NWPU-Crowd Dataset (Issue #22)

Hello, I tried to run the code on [NWPU-Crowd Dataset] downloaded from the following URL https://gjy3035.github.io/NWPU-Crowd-Sample-Code/ but I got this error : Traceback (most recent call last): File "/content/CCTrans/train.py", line 69, in <module> trainer.train() File "/content/CCTrans/train_helper_ALTGVT.py", line 180, in train self.train_epoch() File "/content/CCTrans/train_helper_ALTGVT.py", line 205, in train_epoch outputs, outputs_normed = self.model(inputs) File "/usr/local/lib/python3.8/dist-packages/torch/nn/modules/module.py", line 1102, in _call_impl return forward_call(*input, kwargs) File "/content/CCTrans/Networks/ALTGVT.py", line 477, in forward x = self.forward_features(x) File "/content/CCTrans/Networks/ALTGVT.py", line 468, in forward_features x = blk(x, H, W) File "/usr/local/lib/python3.8/dist-packages/torch/nn/modules/module.py", line 1102, in _call_impl return forward_call(*input, *kwargs) File "/content/CCTrans/Networks/ALTGVT.py", line 252, in forward x = x + self.drop_path(self.attn(self.norm1(x), H, W)) File "/usr/local/lib/python3.8/dist-packages/torch/nn/modules/module.py", line 1102, in _call_impl return forward_call(input, kwargs) File "/content/CCTrans/Networks/ALTGVT.py", line 139, in forward x = x.reshape(B, h_group, self.ws, w_group, self.ws, C).transpose(2, 3) RuntimeError: shape '[8, 1, 8, 1, 8, 1024]' is invalid for input of size 1179648

Many thanks,

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>