Arbaz Qureshi
Arbaz Qureshi

Reputation: 105

I have run this many times but it showing that path is incorrect

Code causing the error:

train_image_gen = image_gen.flow_from_directory ('D:/Semesters/Final Year Project/Images--Datasets/'  target_size = image_shape,batch_size = 64,color_mode= 'grayscale')
test_image_gen = image_gen.flow_from_directory ('D:/Semesters/Final Year Project/Images--Datasets/' target_size = image_shape,color_mode= 'grayscale',shuffle= False,batch_size = 64,class_mode = 'categorical')

Output / error:

File "C:\Users\DELL\.spyder-py3\train.py", line 26
    train_image_gen = image_gen.flow_from_directory ('D:/Semesters/Final Year Project/Images--Datasets/'  target_size = image_shape,batch_size = 64,color_mode= 'grayscale')

SyntaxError: invalid syntax

Upvotes: -1

Views: 65

Answers (1)

hilyap
hilyap

Reputation: 1

I think you are missing a comma after the path/before target_size

it should be:

train_image_gen = image_gen.flow_from_directory ('D:/Semesters/Final Year Project/Images--Datasets/', target_size = image_shape, batch_size = 64, color_mode= 'grayscale')
test_image_gen = image_gen.flow_from_directory ('D:/Semesters/Final Year Project/Images--Datasets/', target_size = image_shape,color_mode= 'grayscale',shuffle= False,batch_size = 64,class_mode = 'categorical')

Upvotes: 0

Related Questions