Hello guys,
I have this problem regarding the train_ssd.py, which is the
warning - could not find image yoto10383 - ignoring from dataset
error. I have been following this tutorial, for doing transfer learning on the SSD-Mobilenet model.
As I downloaded my data from the internet, along with .xml files and images, I did not use the camera capture, and so I jumped directly to training the model.
I have the labels.txt file, the Annotations folder, the ImageSets folder, which contains Main folder with train.txt file, all inside my images folder. They weren’t inside the images folder prior to this, but the errors led me to adding them there, and now this is the last error I am getting:
warning - could not find image yoto10383 - ignoring from dataset
warning - could not find image yoto10412 - ignoring from dataset
warning - could not find image yoto10441 - ignoring from dataset
warning - could not find image yoto10499 - ignoring from dataset
warning - could not find image yoto10557 - ignoring from dataset
warning - could not find image yoto10586 - ignoring from dataset
warning - could not find image yoto10702 - ignoring from dataset
warning - could not find image yoto10731 - ignoring from dataset
warning - could not find image yoto10760 - ignoring from dataset
warning - could not find image yoto10789 - ignoring from dataset
warning - could not find image yoto10818 - ignoring from dataset
warning - could not find image yoto10847 - ignoring from dataset
warning - could not find image yoto10876 - ignoring from dataset
warning - could not find image yoto10905 - ignoring from dataset
warning - could not find image yoto10934 - ignoring from dataset
warning - could not find image yoto10963 - ignoring from dataset
warning - could not find image yoto10992 - ignoring from dataset
warning - could not find image yoto11021 - ignoring from dataset
warning - could not find image yoto11050 - ignoring from dataset
warning - could not find image yoto11079 - ignoring from dataset
warning - could not find image yoto11108 - ignoring from dataset
warning - could not find image yoto11485 - ignoring from dataset
warning - could not find image yoto11920 - ignoring from dataset
2024-07-12 16:34:48 - VOC Labels read from file: (‘BACKGROUND’, ‘’, ‘drone’)
2024-07-12 16:34:48 - Stored labels into file data/images/labels.txt.
2024-07-12 16:34:48 - Train dataset size: 0
Traceback (most recent call last):
File “/home/jetson-orin/jetson-inference/python/training/detection/ssd/pytorch-ssd/train_ssd.py”, line 284, in
train_loader = DataLoader(train_dataset, args.batch_size,
File “/usr/local/lib/python3.10/dist-packages/torch/utils/data/dataloader.py”, line 349, in init
sampler = RandomSampler(dataset, generator=generator) # type: ignore[arg-type]
File “/usr/local/lib/python3.10/dist-packages/torch/utils/data/sampler.py”, line 140, in init
raise ValueError(f"num_samples should be a positive integer value, but got num_samples={self.num_samples}")
ValueError: num_samples should be a positive integer value, but got num_samples=0
I got all the paths right, and so I don’t understand why the train_ssd.py code does not see my images.
This is the command:
$ python3 train_ssd.py --dataset-type=voc --data=/home/jetson-orin/jetson-inference/python/training/detection/ssd/pytorch-ssd/images --model-dir=/home/jetson-orin/jetson-inference/data-models
Could it be that I am missing a folder or .txt file? If so, what should be inside them, and where should I place them? All the tutorials regarding re-training this model involve using the camera capture, which I am not, so maybe this has something to do with it.
My .xml files (in VOC format) point correctly to at least 1 of the images.