wzb-bupt / LandmarkGait

LandmarkGait: Intrinsic Human Parsing for Gait Recognition (ACM MM 2023)
13 stars 0 forks source link

关于维度的问题 #2

Open FlySharker opened 3 weeks ago

FlySharker commented 3 weeks ago

我在分别测试三个阶段的时候,出现了以下问题 在测试LandmarkGait_Silh_to_Landmark时,出现了Traceback (most recent call last): File "D:\p_y\LandmarkGait-main\opengait\main.py", line 73, in run_model(cfgs, training) File "D:\p_y\LandmarkGait-main\opengait\main.py", line 56, in run_model Model.run_test(model) File "D:\p_y\LandmarkGait-main\opengait\modeling\base_model.py", line 442, in run_test info_dict = model.inference(rank) File "D:\p_y\LandmarkGait-main\opengait\modeling\base_model.py", line 396, in inference v = np.concatenate(v)[:total_size] ValueError: all the input array dimensions except for the concatenation axis must match exactly, but along dimension 2, the array at index 0 has size 112 and the array at index 1 has size 118

在测试LandmarkGait_Landmark_to_Parsing和LandmarkGait_Recognition时,出现了T raceback (most recent call last): File "D:\p_y\LandmarkGait-main\opengait\main.py", line 73, in
run_model(cfgs, training)
File "D:\p_y\LandmarkGait-main\opengait\main.py", line 56, in run_model
Model.run_test(model)
File "D:\p_y\LandmarkGait-main\opengait\modeling\base_model.py", line 442, in run_test
info_dict = model.inference(rank)
File "D:\p_y\LandmarkGait-main\opengait\modeling\base_model.py", line 380, in inference
retval = self.forward(ipts)
File "D:\p_y\LandmarkGait-main\opengait\modeling\models\parsingnet.py", line 185, in forward
dilated_mask_head = self.preprocess((des_pred_head_thdes_pred_headup_mask).view(n*s, 1, h, w)) # Dilation RuntimeError: shape '[2, 1, 64, 44]' is invalid for input of size 11264

我在修改配置文件时只改了num_worker,trainer和evaluator的batch_size以及迭代次数,因为我只有一张显卡 我想问一下会不会是数据集的问题呢,因为我在预处理casia-b时提示我有多张图像have no data或less than 5 valid data 而论文中提到的是casia-bn数据集

wzb-bupt commented 3 weeks ago

First, if you follow the official pretreatment in OpenGait and the training phase works well, I think the issue is with the config, not the dataset. Our CASIA-BN is a re-segment version (like CASIA-B*) for high quality as the original CASIA-B was created in 2006 and simply utilizes background subtraction for segmentation.

Second, for test phase in our codebase, the first (_LandmarkGait_Silh_toLandmark) and the second (_LandmarkGait_Landmark_toParsing) don't need the test phase since they don't involve recognition. Only the third stage (_LandmarkGaitRecognition) requires evaluation.

During test phase in _LandmarkGaitRecognition, please double check "batch_size" in evaluator_cfg to suit for your environment. For example, the batch_size should be equal to the gpus number at the test phase.

Finally, if you want to visualize the first two stages, you can utilize "Tensorboard". For example, tensorboard --logdir=<your output folder>

Some visualizations from tensorboard (CCPG examples):

image image image image image

FlySharker commented 2 weeks ago

谢谢您的解答,我目前在最后测试landmark_recognition的时候还是碰到了维度不一致的问题,就是输入是11264,而变换是【2,1,64,44】,是两倍关系。 注意到您昨天更新了修复evaluator_cfg中的bug,将batch_size从8改到4,我想问一下我这个问题是不是由此导致的

wzb-bupt commented 2 weeks ago

@FlySharker Please change the value of ""batch_size" in evaluator_cfg" to 1 to suit your one GPU.

Actually, the batch_size should be equal to the gpus number during the test. Please make sure that there is only one sequence per GPU during the test. The default value is 4 since we use 4 GPUs during the training and test phase : )

FlySharker commented 2 weeks ago

好的,谢谢您的解答!