I have a plaidml keras python script and the (i believe) relevant part is as follows
from __future__ import print_function
import plaidml.keras
plaidml.keras.install_backend()
import os
os.environ["KERAS_BACKEND"] = "plaidml.keras.backend"
os.environ['KMP_DUPLICATE_LIB_OK']='True'
import numpy as np
from keras.preprocessing.image import img_to_array
from keras.models import Sequential, Model
from keras.layers import Dense, Dropout, Flatten, Activation, Input
from keras.layers import Conv2D, MaxPooling2D
from keras import backend as K
from keras.preprocessing.image import ImageDataGenerator
from sklearn.model_selection import train_test_split
import pandas as pd
import time
import glob
import cv2
import keras
from keras_tqdm import TQDMNotebookCallback
# keras, model definition...
cb = TQDMNotebookCallback()
setattr(cb,'on_train_batch_begin',lambda x,y:None)
setattr(cb,'on_train_batch_end',lambda x,y:None)
src_path_train = "D:\projects\record\input_frames\train"
src_path_test = "D:\projects\record\input_frames\train\test"
train_gen = ImageDataGenerator()
test_gen = ImageDataGenerator()
train_generator=train_gen.flow_from_directory(
directory=src_path_train,
classes=None,
class_mode="categorical",
color_mode="rgb",
batch_size=32,
target_size=(1920, 1080),
shuffle=True,
seed=None,
subset='training',
interpolation="bilinear",
follow_links=True,
)
test_generator = test_gen.flow_from_directory(
directory=src_path_test,
target_size=(1920, 1080),
color_mode="rgb",
batch_size=32,
class_mode=None,
shuffle=False,
seed=42
)
When i run the script it gives this output
Traceback (most recent call last):
File "C:\Users\p\Documents\model_train.py", line 43, in <module>
follow_links=True,
File "C:\Users\p\python\lib\site-packages\keras_preprocessing\image\image_data_generator.py", line 543, in flow_from_directory
dtype=self.dtype
File "C:\Users\p\python\lib\site-packages\keras_preprocessing\image\directory_iterator.py", line 115, in __init__
for subdir in sorted(os.listdir(directory)):
OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: 'D:\\projects\record\\input_frames\train'
From what I know the directory path syntax inside the python script is correct
p.s I am using windows 10
I tried to run a pladml keras python script with flow from directory expecting it to create a model using the referenced directory dataset instead it gave an os error relating to invalid directory syntax