question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Exception: index 1000 is out of bounds for axis 0 with size 1000

See original GitHub issue

I am getting the following exception when I run the train_frcnn.py file, when the model finishes running the epochs it goes into an infinite loop printing out the same exception

1000/1000 [==============================] - 592s - rpn_cls: 0.0000e+00 - rpn_regr: 0.0000e+00 - detector_cls: 0.0000e+00 - detector_regr: 0.0000e+00
Exception: name ‘mean_overlapping_boxes’ is not defined Average number of overlapping bounding boxes from RPN = 56.069 for 1000 previous iterations Exception: index 1000 is out of bounds for axis 0 with size 10001

I use the following command to run the train_frcnn.py python train_frcnn.py -o simple -p annotate2.txt --num_epochs=1

I traced back the error to line 243 in train_rcnn.py:

losses[iter_num, 0] = loss_rpn[1]
losses[iter_num, 1] = loss_rpn[2]

losses[iter_num, 2] = loss_class[1]
losses[iter_num, 3] = loss_class[2]
losses[iter_num, 4] = loss_class[3]

did anyone get the same exception or know what is the issue?

this is my first time posting a question so I apologize if i didnt provide much details, please let me know what I missed

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:11

github_iconTop GitHub Comments

5reactions
dbarrientosgcommented, Mar 25, 2021

Did you find any solution?Mine still says the same even if I changed the keras and tensorflow version

I solved this error. The error happens because it miss a “b” in the line 263. So line 274 wont be executed and iter_num wont be set to 0. This provocate the error “index 1000 is out of bounds for axis 0 with size 10001” in the line 243 when the loop start again.

The correct line of code is for line 263 is:

print(f’Mean number of bounding boxes from RPN overlapping ground truth boxes: {mean_overlapping_bboxes}')

2reactions
dbarrientosgcommented, Mar 29, 2021

Did you find any solution?Mine still says the same even if I changed the keras and tensorflow version

I solved this error. The error happens because it miss a “b” in the line 263. So line 274 wont be executed and iter_num wont be set to 0. This provocate the error “index 1000 is out of bounds for axis 0 with size 10001” in the line 243 when the loop start again. The correct line of code is for line 263 is: print(f’Mean number of bounding boxes from RPN overlapping ground truth boxes: {mean_overlapping_bboxes}')

Thank you but can you tell me on which file I should edit this?

train_rcnn.py

Read more comments on GitHub >

github_iconTop Results From Across the Web

IndexError: index 1000 is out of bounds for axis 0 with size 1000
This line is giving you the error i += 1. If you plan on using the while loop, don't forget to add your...
Read more >
index 1000 is out of bounds for axis 0 with size 1000 - You.com
The error is telling you that you have an axis of 1000 and you try reaching the 1000th element. This is perfectly logical,...
Read more >
Exception: index 1000 is out of bounds for axis 0 with size ...
I solved this error. The error happens because it miss a "b" in the line 263. So line 274 wont be executed and...
Read more >
IndexError: index 0 is out of bounds for axis 0 with size 0
The Python "IndexError: index 0 is out of bounds for axis 0 with size 0" occurs when we try to access the first...
Read more >
IndexError: index 2 is out of bounds for axis 0 with size 2
(A) This error happens when you try to use a column index value does not exist as it is outside the index values...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found