Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when training in notebook with different image size #48

Open
muxgt opened this issue Oct 14, 2019 · 2 comments
Open

Error when training in notebook with different image size #48

muxgt opened this issue Oct 14, 2019 · 2 comments

Comments

@muxgt
Copy link

muxgt commented Oct 14, 2019

Hi! I'm trying to train the model on my dataset in notebook #4 with pictures of size 288x288. I have changed image sizes here:

`

Create training generator

train_datagen = AugmentingDataGenerator(
rotation_range=10,
width_shift_range=0.1,
height_shift_range=0.1,
rescale=1./255,
horizontal_flip=True
)
train_generator = train_datagen.flow_from_directory(
TRAIN_DIR,
MaskGenerator(288, 288, 3),
target_size=(288, 288),
batch_size=BATCH_SIZE
)

Create validation generator

val_datagen = AugmentingDataGenerator(rescale=1./255)
val_generator = val_datagen.flow_from_directory(
VAL_DIR,
MaskGenerator(288, 288, 3),
target_size=(288, 288),
batch_size=20,
classes=['val'],
seed=42
)

Create testing generator

test_datagen = AugmentingDataGenerator(rescale=1./255)
test_generator = test_datagen.flow_from_directory(
TEST_DIR,
MaskGenerator(288, 288, 3),
target_size=(288, 288),
batch_size=20,
seed=42
)`

but receiving the following error:

ValueError: Error when checking input: expected inputs_img to have shape (512, 512, 3) but got array with shape (288, 288, 3)

in cell #44 when starting to train.

Is there a way to train on a different size or only 512x512?

@ningscapr
Copy link

ningscapr commented Feb 19, 2020

I have the same probelm here. Did you find any solution?

@muxgt
Copy link
Author

muxgt commented Feb 20, 2020

Yes, you also need to change size in the file pconv_model.py in line 21.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants