0

please would anyone help with codes for grayscale image count in TensorFlow? This is what I have tried and I am getting smaller count (say 48) compare with more than a thousand images in the folder.

My data in DATADIR:

image_count = len(list(DATADIR))
print("No of Images =", image_count)
Andrey
  • 5,932
  • 3
  • 17
  • 35
  • 1
    Is it what you need https://stackoverflow.com/questions/2632205/how-to-count-the-number-of-files-in-a-directory-using-python ? – Andrey Nov 16 '20 at 10:27
  • Post more of your code, specifically where `DATADIR` is defined. I suspect `DATADIR` is a `str` of the filepath, which happens to be 48 characters long. You probably want to call `os.listdir()`. – GordonAitchJay Nov 17 '20 at 15:01

0 Answers0