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

HRNet #805

Open
1334233852 opened this issue May 9, 2024 · 3 comments
Open

HRNet #805

1334233852 opened this issue May 9, 2024 · 3 comments

Comments

@1334233852
Copy link

1334233852 commented May 9, 2024

HRNet相关问题,老师您好,请问HRNet自适应任何分辨率的图片尺寸大小吗,我自制的数据集图片尺寸大小是1280x720的,但是训练的时候出现RuntimeError: The size of tensor a (180) must match the size of tensor b (184) at non-singleton dimension 3,是不是720这个维度在stage4里面做下采样的时候一直到45的时候再下采样就除不尽的,不知道是不是这个原因,老师可否有高见!谢谢!

@WZMIAOMIAO
Copy link
Owner

WZMIAOMIAO commented May 10, 2024

不支持动态分辨率哦,你可以看下train.py文件,--fixed-size写死的是256x192,你可以根据你自己的数据集修改下--fixed-size

parser.add_argument('--fixed-size', default=[256, 192], nargs='+', type=int, help='input size')

@1334233852
Copy link
Author

老师您好,这个问题我也注意到了,但我还有个问题,就是说如果我数据集分辨率是1280x720的话,我对应的关键点标注信息也是对应1280x720的,如果我对数据集原始图片进行resize变成384x288或者256x192那么我的标签如何处理,或者我在数据增强那里,对输入到网络的图片大小进行resize那么标签应该如何处理!感谢老师!恳请给个意见

@1334233852
Copy link
Author

老师,我这里对我的数据和标签进行了调整,都弄成了384x288的尺寸大小,但是在评估的时候使用coco的标准,coco2017人体关键点检测是17个,我这里不是17,只有8个,我在coco_eval里面做了调整还是出现这个问题,请问老师有何高见 Traceback (most recent call last):
File "/media/cmf/EEA2072AA206F73D/VOS_related_Project/KeyPoint/HRNet/train_multi_GPU.py", line 272, in
main(args)
File "/media/cmf/EEA2072AA206F73D/VOS_related_Project/KeyPoint/HRNet/train_multi_GPU.py", line 164, in main
key_info = utils.evaluate(model, data_loader_test, device=device,
File "/home/cmf/anaconda3/envs/xmem-repro/lib/python3.9/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
return func(*args, kwargs)
File "/media/cmf/EEA2072AA206F73D/VOS_related_Project/KeyPoint/HRNet/train_utils/train_eval_utils.py", line 115, in evaluate
coco_info = key_metric.evaluate()
File "/media/cmf/EEA2072AA206F73D/VOS_related_Project/KeyPoint/HRNet/train_utils/coco_eval.py", line 128, in evaluate
self.coco_evaluator.evaluate()
File "/home/cmf/anaconda3/envs/xmem-repro/lib/python3.9/site-packages/pycocotools/cocoeval.py", line 148, in evaluate
self.ious = {(imgId, catId): computeIoU(imgId, catId)
File "/home/cmf/anaconda3/envs/xmem-repro/lib/python3.9/site-packages/pycocotools/cocoeval.py", line 148, in
self.ious = {(imgId, catId): computeIoU(imgId, catId)
File "/home/cmf/anaconda3/envs/xmem-repro/lib/python3.9/site-packages/pycocotools/cocoeval.py", line 229, in computeOks
e = (dx
2 + dy**2) / vars / (gt['area']+np.spacing(1)) / 2
ValueError: operands could not be broadcast together with shapes (8,) (17,)

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