-4

I'm trying to read images from the specified folder enrollemnts_rgb but it gives an error, not in the directory

for folder_name in folder_list:
    files_list = os.listdir(os.path.join(base_dir, folder_name))
    temp=[]
    for file_name in files_list[:no_of_files_in_each_class]:
        temp.append(len(x))
stateMachine
  • 5,227
  • 4
  • 13
  • 29

1 Answers1

3

It seems like the error is specifically Not a directory not not in the directory as your question asserts.

My assumption is your error is actually not in the code you shared. Your folder_list probably contains non-folder files. This makes listdir throw an error, as you're passing in a non-folder path.

Check your folder_list implementation.

jorf.brunning
  • 452
  • 4
  • 9