У меня ошибка, когда я хочу получить путь к изображению в своей папке ..
путь = os.fspath (путь)
TypeError: ожидаемый объект str, bytes или os.PathLike, а не список
А это мой код:
root_dir = './test/'
#######################Enumerate classes###################################
class_folders_train = glob.glob(os.path.join(root_dir, '*'))
print("class_folders_train :",class_folders_train)
train_paths = []
for idx, class_folder in enumerate(class_folders_train):
print("ok")
image_paths = glob.glob(os.path.join(class_folders_train, '*.tif'))
print("image_paths :",image_paths)
train_paths.extend([(im_path, idx) for im_path in image_paths])
print("train_paths :",train_paths)
Так что мой код умирает сразу после печати («ОК») ...