Closed dkobayas-cyber closed 1 year ago
Some updates on this issue.
I got the same error message when testing the HRFormer on the COCO dataset using the default configuration file, configs/body_2d_keypoint/topdown_heatmap/coco/td-hm_hrformer-base_8xb32-210e_coco-256x192.py.
CLI command I used for testing
python demo/image_demo.py tests/data/coco/000000000785.jpg configs/body_2d_keypoint/topdown_heatmap/coco/hrformer_example.py work_dirs/hrformer_example/best_coco_AP_epoch_1.pth --out-file work_dirs/hrformer_example/vis_results.png
I found that running_mean
and running_var
tensors in torch.nn.functional.batch_norm
are sometimes on CPU. After moving them to GPU inside of batch_norm
function, the problem has been resolved. The related post on Pytorch forum is here.
But I'm not sure why these tensors are on CPU for some layers. Do you have any idea why? If I can figure out more fundamental reasons, that would be better.
@dkobayas-cyber I run with same error in mmtrack and it was image that was on the cpu.
in the mmpose/api/inference.py
try to get the line 185
` if data_list:
# batch['inputs']: a list of input images
# batch['data_samples']: a list of :obj:`PoseDataSample`
batch = pseudo_collate(data_list)`
here if you check the all the keys of this batch then it's likely that the input images are on the cpu.
Bug description
When I try to predict 2D keypoints by HRFormer by:
I get an error message below:
Expand the full error message:
Notes
Config file I almost directly used configs/body_2d_keypoint/topdown_heatmap/coco/td-hm_hrformer-base_8xb32-210e_coco-256x192.py except that I used my custom dataset.
The configuration file is shown here