-
Notifications
You must be signed in to change notification settings - Fork 19.7k
Closed
Description
Hi, I'm trying to run variable-sized images through convolutional layers but I'm getting an error about the row sizes not matching. From what i understand in this post, I should be able to use a snippet like
from keras.models import Sequential
from keras.layers import Convolution2D
import numpy as np
m = Sequential()
m.add(Convolution2D(8, 3, 3, input_shape=(1, 10, 10)))
m.compile(loss="mae", optimizer="sgd")
c = m.predict(np.random.rand(1, 1, 10, 10))
c = m.predict(np.random.rand(1, 1, 20, 20))However, the second predict statement throws an error:
ValueError: The hardcoded shape for the number of rows in the image (10) isn't the run time shape (20).
Is there some way to use this in an input-shape independent fashion?
hiteshnitetc, kongaskristjan, omid-s, alexbertis, saeidrhm and 4 more
Metadata
Metadata
Assignees
Labels
No labels