Hey there,
I would like to create an object detection for my own dataset wich includes 5 different classes. Therfore I checked out the Tutorial Object Detection Finetunig. How can I change the code to train the model on my own pictures and classes? Is there any example?
First I imported my own Data and of course changed the names where the Data is used. But how can I change the number of classes? Right now I only changed the varialbe num_classes to 6. What else do i have to do?
Can you tell me what code I have to add?
If I start training I get this error:
/usr/local/lib/python3.6/dist-packages/torch/nn/functional.py:2854: UserWarning: The default behavior for interpolate/upsample with float scale_factor will change in 1.6.0 to align with other frameworks/libraries, and use scale_factor directly, instead of relying on the computed output size. If you wish to keep the old behavior, please set recompute_scale_factor=True. See the documentation of nn.Upsample for details. warnings.warn("The default behavior for interpolate/upsample with float scale_factor will change "
Loss is nan, stopping training {‘loss_classifier’: tensor(1.8139, device=‘cuda:0’, grad_fn=), ‘loss_box_reg’: tensor(nan, device=‘cuda:0’, grad_fn=), ‘loss_mask’: tensor(2.0006, device=‘cuda:0’, grad_fn=), ‘loss_objectness’: tensor(17.6392, device=‘cuda:0’, grad_fn=), ‘loss_rpn_box_reg’: tensor(19.2071, device=‘cuda:0’, grad_fn=)}
An exception has occurred, use %tb to see the full traceback.
SystemExit: 1
I created my Label with Labelbox. How can I ttest my data loader? If I print the pictures, they are shown correctly.
Probably it’s because dataset from tutorial is only for one class detection.
And it doesn’t raise an error if you have several classes on image.
I’m looking for example of training data for multicalss detection too.
If you solve this issue please help me, I can’t understand how to prepare data for training, I have image and mask with 5 classes on it, but how the boxes should look like if there is several objects for one class and so on… cant understand
p.s. pytorch tutorials are misleading