HRNet / Lite-HRNet

This is an official pytorch implementation of Lite-HRNet: A Lightweight High-Resolution Network.
Apache License 2.0
820 stars 126 forks source link

summary_network.py error #11

Closed SatMa34 closed 3 years ago

SatMa34 commented 3 years ago

when i try to run summary_network through "python tools/summary_network.py configs/top_down/lite_hrnet/coco/litehrnet_18_coco_256x192.py --shape 256 256 --with-head", a error raise as follows: Traceback (most recent call last): File "tools/summary_network.py", line 80, in main() File "tools/summary_network.py", line 45, in main model = build_posenet(cfg.model) File "/usr/local/lib/python3.6/site-packages/mmpose/models/builder.py", line 52, in build_posenet return build(cfg, POSENETS) File "/usr/local/lib/python3.6/site-packages/mmpose/models/builder.py", line 27, in build return build_from_cfg(cfg, registry, default_args) File "/usr/local/lib/python3.6/site-packages/mmcv/utils/registry.py", line 182, in build_from_cfg raise type(e)(f'{obj_cls.name}: {e}') KeyError: "TopDown: 'LiteHRNet is not in the backbone registry'"

but, if i replace "from mmpose.models import build_posenet" with "from models.builder import build_posenet", it raise another error:

Traceback (most recent call last): File "tools/summary_network.py", line 80, in main() File "tools/summary_network.py", line 62, in main format(model.class.name)) NotImplementedError: FLOPs counter is currently not currently supported with TopDown

So, how can i correctly cal the flops and mac.

besides, i have trans the smallest model to ncnn, but for inference time, it's not faster than mobilenetv2, have you tested the inference time with mobilenetv2?

yu-changqian commented 3 years ago

Thanks for pointing it out. I have fixed this issue and updated the codes. You can try the updated codes to compute the flops.