cv516Buaa/tph-yolov5

Higher pytorch verision has a typeError "meshgrid() got an unexpected keyword argument 'indexing'"

Opened this issue · 1 comments

File "/root/autodl-tmp/tph-yolov5/models/common.py", line 259, in init
coords = torch.stack(torch.meshgrid([coords_h, coords_w], indexing="ij")) # [2, Mh, Mw]
TypeError: meshgrid() got an unexpected keyword argument 'indexing'

Deleting ", indexing="ij"" like this can run well. coords = torch.stack(torch.meshgrid([coords_h, coords_w]))

Code cannot running on the device which pytorch version higher than 1.9.0.

https://blog.csdn.net/qq_43391414/article/details/122902091?utm_medium=distribute.pc_aggpage_search_result.none-task-blog-2~aggregatepage~first_rank_ecpm_v1~rank_v31_ecpm-8-122902091.pc_agg_new_rank&utm_term=meshgrid%E4%B8%ADindexing&spm=1000.2123.3001.4430

There is a similar issue in #20 (comment)

File "/root/autodl-tmp/tph-yolov5/models/common.py", line 259, in init coords = torch.stack(torch.meshgrid([coords_h, coords_w], indexing="ij")) # [2, Mh, Mw] TypeError: meshgrid() got an unexpected keyword argument 'indexing'

Deleting ", indexing="ij"" like this can run well. coords = torch.stack(torch.meshgrid([coords_h, coords_w]))

Code cannot running on the device which pytorch version higher than 1.9.0.

https://blog.csdn.net/qq_43391414/article/details/122902091?utm_medium=distribute.pc_aggpage_search_result.none-task-blog-2~aggregatepage~first_rank_ecpm_v1~rank_v31_ecpm-8-122902091.pc_agg_new_rank&utm_term=meshgrid%E4%B8%ADindexing&spm=1000.2123.3001.4430

There is a similar issue in #20 (comment)

using pytorch1.10 can slove this problem