-
Notifications
You must be signed in to change notification settings - Fork 50
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
IndexError: index 909 is out of bounds for dimension 0 with size 900 #41
Comments
I met the same problem. Have you found a solution? |
Could you please provide more details? For example, the specific values of tgt_ids and indices. |
i printed the recent output of the error line "tgt_ids[i]=tgt_ids[i][indices[i][1]]", and I found that this only happens when I use the SOTA dataset in SAMRS.
|
I suspected that the number of instances in the image could not be more than the number of queries (is 900), so I deleted all the images with more than 900 instances in the dataset and can now train normally |
this is my train logs: i have only 1 class ,but i get the same question with you ,but my datasets have no object 。 |
I've encountered the same problem. Open-GroundingDino/models/GroundingDINO/groundingdino.py", line 665, in init |
我在我自己的数据集上训练,完整报错如下:
Traceback (most recent call last):
File "/mnt/lvm_data/project/xyguo/code_dmx/Open-GroundingDino/main.py", line 372, in
main(args)
File "/mnt/lvm_data/project/xyguo/code_dmx/Open-GroundingDino/main.py", line 284, in main
train_stats = train_one_epoch(
File "/mnt/lvm_data/project/xyguo/code_dmx/Open-GroundingDino/engine.py", line 48, in train_one_epoch
loss_dict = criterion(outputs, targets, cap_list, captions)
File "/mnt/lvm_data/public/package/anaconda3/envs/groundingdino_env/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/mnt/lvm_data/project/xyguo/code_dmx/Open-GroundingDino/models/GroundingDINO/groundingdino.py", line 596, in forward
tgt_ids[i]=tgt_ids[i][indices[i][1]]
IndexError: index 909 is out of bounds for dimension 0 with size 900
通过翻阅代码,发现应该下图中的两行代码产生的索引值超出了for循环中tgt_ids[i]的长度,请问应该怎么改呢?
![image](https://private-user-images.githubusercontent.com/81793539/286874616-72cfdb22-8eb0-4fd1-be76-95f3ed633787.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjI0NzI3ODMsIm5iZiI6MTcyMjQ3MjQ4MywicGF0aCI6Ii84MTc5MzUzOS8yODY4NzQ2MTYtNzJjZmRiMjItOGViMC00ZmQxLWJlNzYtOTVmM2VkNjMzNzg3LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MDElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODAxVDAwMzQ0M1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTA5YzMxMTc1M2FiZWRiYjE5N2ZjNDg3NzE5YzY4ODkxOWIyZDk4Zjk4ZTM1YjNkZGQxMDI1ZTI0MjQ5MjEwZGImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.43rBRdrLZqomySi_ud60eJ9sdSl3Lh-HhUIPHFwyKzc)
The text was updated successfully, but these errors were encountered: