shanice-l / gdrnpp_bop2022

PyTorch Implementation of GDRNPP, winner (most of the awards) of the BOP Challenge 2022 at ECCV'22
Apache License 2.0
242 stars 51 forks source link

Running into PyTorch errors when training on YCBV #69

Closed jfitzg7 closed 10 months ago

jfitzg7 commented 1 year ago

I get this error when training on YCBV

  File "/data2/6d-pose-estimation/gdrnpp_bop2022/core/gdrn_modeling/../../core/gdrn_modeling/models/GDRN_double_mask.py", line 110, in forward
    coor_x = coor_x[torch.arange(bs).to(device), roi_classes]
             │      │     │      │      │        └ tensor([ 0.,  8.,  0., 20.,  6.,  6., 13.,  9.,  9., 19.,  2.,  7.,  1., 13.,
             │      │     │      │      │                   9., 19., 19.,  1.,  4., 14., 10.,  0.,...
             │      │     │      │      └ device(type='cuda', index=0)
             │      │     │      └ 24
             │      │     └ <built-in method arange of type object at 0x7f5c5a6f3200>
             │      └ <module 'torch' from '/home/exx/anaconda3/envs/gdrnpp/lib/python3.9/site-packages/torch/__init__.py'>
             └ tensor([[[[[ 2.3970e-02,  5.5300e-02,  5.9322e-02,  ...,  1.4891e-02,
                            2.1189e-02,  3.0447e-02],
                          [ 1.7...

IndexError: tensors used as indices must be long, byte or bool tensors

I'm running torch==1.10.0+cu111

If possible, can you guys post the exact versions for every package you used? Posting the exact package versions will help others like me that just want to get things up and running without too much trial and error.

shanice-l commented 10 months ago

You can transfer roi_classes to a long tensor.

jfitzg7 commented 10 months ago

Thank you @shanice-l !