Training on jetson-inference getting error FileNotFoundError: Found no valid file for the classes Drowsy. Supported extensions are: .jpg, .jpeg,

JP4.6, Pytorch 1.9,torchvision=0.10. Python=3.6.9.

arctic@arctic-desktop:~/Downloads/jetson-inference/python/training/classification$ python3 train.py --model-dir=models/Driver --batch-size=2 --workers=1 --epochs=30 ~/Downloads/jetson-inference/python/training/classification/data/Driver

Use GPU: 0 for training
=> dataset classes:  2 ['Awake', 'Drowsy']
Traceback (most recent call last):
  File "train.py", line 506, in <module>
    main()
  File "train.py", line 135, in main
    main_worker(args.gpu, ngpus_per_node, args)
  File "train.py", line 191, in main_worker
    normalize,
  File "/usr/local/lib/python3.6/dist-packages/torchvision-0.10.0a0+300a8a4-py3.6-linux-aarch64.egg/torchvision/datasets/folder.py", line 313, in __init__
    is_valid_file=is_valid_file)
  File "/usr/local/lib/python3.6/dist-packages/torchvision-0.10.0a0+300a8a4-py3.6-linux-aarch64.egg/torchvision/datasets/folder.py", line 146, in __init__
    samples = self.make_dataset(self.root, class_to_idx, extensions, is_valid_file)
  File "/usr/local/lib/python3.6/dist-packages/torchvision-0.10.0a0+300a8a4-py3.6-linux-aarch64.egg/torchvision/datasets/folder.py", line 192, in make_dataset
    return make_dataset(directory, class_to_idx, extensions=extensions, is_valid_file=is_valid_file)
  File "/usr/local/lib/python3.6/dist-packages/torchvision-0.10.0a0+300a8a4-py3.6-linux-aarch64.egg/torchvision/datasets/folder.py", line 102, in make_dataset
    raise FileNotFoundError(msg)
FileNotFoundError: Found no valid file for the classes Drowsy. Supported extensions are: .jpg, .jpeg, .png, .ppm, .bmp, .pgm, .tif, .tiff, .webp

I clearly Have jpgs in the folders, I have followed the S3E3 youtube video on classification to a T. Yet im getting this error. I tried setting the writing down the whole directory instead of “data/Driver”. Both did not work

Update: I removed the pictures captured from camera-capture program from test/val and train folders and replaced them with images taken manually. This seemed to have fixed the problem. Why did that happen? Is there a bug with the camera-capture program?

Hi @ArcticGrass, if you still have your original dataset and can send it to me (i.e. upload it to google drive or similar), I can take a look and let you know. Thanks.

I solved the problem by uninstalling pytorch and torchvision and installing the bundled pytorch that came with the jetson-inference tools.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.