-2

Is is possible to run prediction on images with different sizes than the training data? I have trained a unet_learner on pictures of a certain size (1000*1000) and exported it for later use.

I then load it with the following:

learn = load_learner(modelpath)
preds = learn.predict(image) 

But what happens if the size of the input image is different?

Morten
  • 3,778
  • 2
  • 25
  • 45
  • https://stackoverflow.com/questions/41907598/how-to-train-images-when-they-have-different-size. – akhetos Aug 16 '19 at 09:38

1 Answers1

1

Neural network is a stack of neuron-layers, Number of neurons at input layer depends on the shape of the input and weights are assigned based on this shape at input layer. So you cannot change the input size/shape once the network is trained.

So, before feeding the input to network, resize the image and transform it to numpy array, reshape the array as per the required input dimensions.