Closed mihuzz closed 4 years ago
This looks like not all of the directories were created before running the example. I've also reworked much of the GAN code for TensorFlow 2.0, so I am closing the GAN related items. If you still believe there is an error in the code that would cause this, please reopen. But at this point, I cannot reproduce.
training_binary_path = os.path.join(DATA_PATH,f'trainingdata{GENERATESQUARE}{GENERATE_SQUARE}.npy')
print(f"Looking for file: {training_binary_path}")
if not os.path.isfile(training_binary_path): print("Loading training images...")
training_data = [] faces_path = os.path.join(DATA_PATH,'lfw') for filename in tqdm(os.listdir(faces_path)): path = os.path.join(faces_path, filename) image = Image.open(path).resize((GENERATE_SQUARE,GENERATE_SQUARE),Image.ANTIALIAS) training_data.append(np.asarray(image)) training_data = np.reshape(training_data,(-1,GENERATE_SQUARE,GENERATE_SQUARE,IMAGE_CHANNELS)) training_data = training_data / 127.5 - 1.
print("Saving training image binary...") np.save(training_binary_path,training_data) else: print("Loading previous training pickle...") training_data = np.load(training_binary_path) IsADirectoryError Traceback (most recent call last)