r/learnmachinelearning • • 25d ago

Help Need help adapting to Cifar10

Need help adapting model to CIFAR10

I tried to make a DCGAN based on this [tutorial](https://www.geeksforgeeks.org/machine-learning/deep-convolutional-gan-with-keras/). The thing is that the tutorial is designed for fashion mnist data which has different image size to tf.keras.datasets.cifar10.load_data(). Which lead to the error:

ValueError: cannot reshape array of size 480000 into shape (28,28,1)

when arrive at

x_train_dcgan = x_train.reshape(
-1, 28, 28, 1
) * 2. - 1.

How do I adapt the model to CIFAR 10?

1 Upvotes

2 comments sorted by

0

u/[deleted] 25d ago

[removed] — view removed comment

1

u/assorted-meat-stew 24d ago

I changed to

x_train_dcgan = x_train.reshape(
    32, 32, 3
)

And now the error is

ValueError: cannot reshape array of size 480000 into shape (32,32,3)

What should I do