ShiqiYu / OpenGait

A flexible and extensible framework for gait recognition. You can focus on designing your own models and comparing with state-of-the-arts easily with the help of OpenGait.
664 stars 154 forks source link

SkeletonGait++ size error in Gait3D #219

Closed YingQQ666 closed 3 weeks ago

YingQQ666 commented 3 weeks ago

[2024-06-03 20:02:13] [INFO]: {'find_unused_parameters': False, 'enable_float16': True, 'with_test': True, 'fix_BN': False, 'log_iter': 100, 'restore_ckpt_strict': True, 'optimizer_reset': False, 'scheduler_reset': False, 'restore_hint': 0, 'save_iter': 20000, 'save_name': 'SkeletonGaitPP', 'sync_BN': True, 'total_iter': 60000, 'sampler': {'batch_shuffle': True, 'batch_size': [32, 4], 'frames_num_fixed': 30, 'frames_num_max': 50, 'frames_num_min': 25, 'sample_type': 'fixed_ordered', 'type': 'TripletSampler', 'frames_skip_num': 4}, 'transform': [{'type': 'Compose', 'trf_cfg': [{'type': 'RandomPerspective', 'prob': 0.2}, {'type': 'BaseSilTransform'}, {'type': 'RandomHorizontalFlip', 'prob': 0.2}, {'type': 'RandomRotate', 'prob': 0.2}]}]} [2024-06-03 20:02:13] [INFO]: {'model': 'SkeletonGaitPP', 'Backbone': {'in_channels': 3, 'blocks': [1, 4, 4, 1], 'C': 2}, 'SeparateBNNecks': {'class_num': 3000}} [2024-06-03 20:02:14] [INFO]: {'dataset_name': 'Gait3D', 'dataset_root': '/home/datasets/Gait3D_mm/', 'num_workers': 1, 'dataset_partition': './datasets/Gait3D/Gait3D.json', 'remove_no_gallery': False, 'cache': False, 'test_dataset_name': 'Gait3D', 'data_in_use': [True, True]} [2024-06-03 20:02:14] [INFO]: -------- Train Pid List -------- [2024-06-03 20:02:14] [INFO]: [1234, 1512, ..., 1128] [2024-06-03 20:02:15] [INFO]: -------- Test Pid List -------- [2024-06-03 20:02:15] [INFO]: [0002, 0007, ..., 3064] [2024-06-03 20:02:15] [INFO]: {'lr': 0.1, 'momentum': 0.9, 'solver': 'SGD', 'weight_decay': 0.0005} [2024-06-03 20:02:15] [INFO]: {'gamma': 0.1, 'milestones': [20000, 30000, 40000], 'scheduler': 'MultiStepLR'} [2024-06-03 20:02:17] [INFO]: Parameters Count: 25.56861M [2024-06-03 20:02:17] [INFO]: Model Initialization Finished! pose: torch.Size([64, 3, 30, 64, 64]) pose: torch.Size([64, 3, 30, 64, 64]) Traceback (most recent call last): File "/home/code/opengait-gitee/opengait/main.py", line 73, in run_model(cfgs, training) File "/home/code/opengait-gitee/opengait/main.py", line 56, in run_model Model.run_train(model) File "/home/code/opengait-gitee/opengait/modeling/base_model.py", line 408, in run_train retval = model(ipts) File "/root/anaconda3/envs/opengait/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl Traceback (most recent call last): File "/home/code/opengait-gitee/opengait/main.py", line 73, in return self._call_impl(*args, kwargs) File "/root/anaconda3/envs/opengait/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl run_model(cfgs, training) File "/home/code/opengait-gitee/opengait/main.py", line 56, in run_model Model.run_train(model) File "/home/code/opengait-gitee/opengait/modeling/base_model.py", line 408, in run_train return forward_call(*args, *kwargs) File "/root/anaconda3/envs/opengait/lib/python3.9/site-packages/torch/nn/parallel/distributed.py", line 1519, in forward retval = model(ipts) File "/root/anaconda3/envs/opengait/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl else self._run_ddp_forward(inputs, kwargs) File "/root/anaconda3/envs/opengait/lib/python3.9/site-packages/torch/nn/parallel/distributed.py", line 1355, in _run_ddp_forward return self._call_impl(*args, kwargs) File "/root/anaconda3/envs/opengait/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl return self.module(*inputs, *kwargs) # type: ignore[index] File "/root/anaconda3/envs/opengait/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl return forward_call(args, kwargs) File "/root/anaconda3/envs/opengait/lib/python3.9/site-packages/torch/nn/parallel/distributed.py", line 1519, in forward return self._call_impl(*args, kwargs) File "/root/anaconda3/envs/opengait/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl else self._run_ddp_forward(*inputs, *kwargs) File "/root/anaconda3/envs/opengait/lib/python3.9/site-packages/torch/nn/parallel/distributed.py", line 1355, in _run_ddp_forward return forward_call(args, kwargs) File "/home/code/opengait-gitee/opengait/modeling/models/skeletongait++.py", line 99, in forward assert pose.size(-1) in [44, 48, 88, 96]

Followed the Readme, training the SkeletonGait++ on Gait3D, but meet this error. The problem code in SkeletonGait++.py: def forward(self, inputs): ipts, labs, , , seqL = inputs pose = ipts[0] pose = pose.transpose(1, 2).contiguous() print('pose:',pose.shape) assert pose.size(-1) in [44, 48, 88, 96] maps = pose[:, :2, ...] sils = pose[:, -1, ...].unsqueeze(1) try to print the pose.shape, it is torch.Size([64, 3, 30, 64, 64]).

jdyjjj commented 3 weeks ago

You can use BaseSilCuttingTransform rather than BaseSilTransform in transform

YingQQ666 commented 3 weeks ago

You can use BaseSilCuttingTransform rather than BaseSilTransform in transform

Thank you very much