0
votes

I am trying to upscale the MNIST handwritten digit images before training. But both cv2.resize() and skimage.transform.resize throws : ValueError: could not broadcast input array from shape (150,150) into shape (28,28)

    for i in range(len(X_train)):
      X_train[i] = resize(X_train[i], (150,150))
1
What's the full error message? I suspect the error is in the X[i]=... assignment, not the resize. What's the shape of X_train? - hpaulj
What happens if you execute tmp = resize(X_train[i], (150,150)) - Rotem
aahh! Now I get the issue! 'tmp = resize(X_train[0], (150,150))' runs perfectly. As X_train is of shape(60000,28,28,1) the assignement was causing the error. Thanks. - Abhimanyu Das

1 Answers

0
votes

Aahh! Now I get the issue! 'tmp = resize(X_train[0], (150,150))' runs perfectly. As X_train is of shape(60000,28,28,1) so the assignement was causing the error.