Skip to content

How to write training loop for object detection using rastervision and pytorch-lightning #1769

Answered by AdeelH
aerotractjack asked this question in Q&A
Discussion options

You must be logged in to vote

I believe this error occurs because my prediction has many more bounding boxes than my ground truth, but that seems like a normal issue that would occur in training, so I'm not sure how to fix it. Any help is appreciated

No, the 'index' in the error is referring to the class ID. Try the following:

  • remove the background/null class from your ClassConfig
  • when creating the FasterRCNN use num_classes=(len(class_config) + 1)

And here is the error message I get when I run the validation_step()

Torchvision OD models behave differently during validation. Instead of returning losses, they return predicted boxes.

This might help: https://github.com/azavea/raster-vision/blob/master/rastervision…

Replies: 3 comments 7 replies

Comment options

You must be logged in to vote
2 replies
@aerotractjack
Comment options

@aerotractjack
Comment options

Comment options

You must be logged in to vote
4 replies
@aerotractjack
Comment options

@aerotractjack
Comment options

@AdeelH
Comment options

@aerotractjack
Comment options

Answer selected by aerotractjack
Comment options

You must be logged in to vote
1 reply
@AdeelH
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants