Not detecting the custom object
See original GitHub issuehave trained the model on about 126 images, 30% images contain two objects in a image
from detecto import core, utils, visualize
dataset = core.Dataset('../custom_dataset/')
model = core.Model(['stamp'])
model.fit(dataset)
model.save('model_weights_3.pth')
print(f'[INFO] Model Saved successfully!')
image = utils.read_image('../custom_dataset/page-15.jpg')
predictions = model.predict(image)
print(predictions)
Output:
/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 "
[INFO] Model Saved successfully!
([], tensor([], size=(0, 4)), tensor([]))
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Custom trained object detection model not working #8528
Bug. I have recently trained a custom object detection model for YOLOv5 with makesense.ai . I exported as a label file, and I...
Read more >Custom object tab not visible for Users - Salesforce Help
In Salesforce Classic UI · The tab may be hidden for the Profile. Go to the User's profile and change it to Default...
Read more >Tensorflow GPU Custom Object Detection not working
I am building a custom model to detect two objects using tensorflow and Faster_Rcnn_inception_v2 model. For this I have used 600 images which ......
Read more >Custom Object Detection With TensorFlow.js Possible?
I'm trying to find a way to do the training with tfjs. If not possible from scratch, I was hoping there was at...
Read more >How to train YOLOv2 to detect custom objects
The custom object we want to detect in this article is the NFPA 704 'fire diamond'. ... Important GPU is needed to training...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
you were absolutely right! there is a problem in dataset. one of the xml file filename was not matching with image name. i removed them, rechecked the dataset and file names.
continued with
pip install detecto
and boom, it predicted my object with 0.96 confidence…thanks alot
@prasad01dalavi so you’re saying the error goes away when you run it with
pip install detecto
? If so, can you try the suggestions in my first comment again regarding settingverbose=True
to see what the model loss is while training? Blank tensors are a sign that your model might not be trained well enough.@jagilley spent some time going through your Drive folder to see if I could get it to work (I created a Colab file which you can browse through, but it’s very messy). It seems like there’s some issue with your dataset for some reason, which is causing
nan
losses to come up every time during training:I’m not sure why this is the case, but I can try looking deeper into it over the next few days. In the meantime though, hopefully this helps a bit in clearing up what exactly is happening.