简体   繁体   中英

Reshape input_data(shape=[None, 28, 28, 1]) to input_data(shape=[None, 28, 28])

I have a variable :

network = input_data(shape=[None, 28, 28, 1])

I want to convert it to the above shape. I'm doing it with help of tflearn.reshape but it isn't working properly. Here is the code "

network = tflearn.reshape(network,(-1, 28, 28))

I don't want to redeclare it to shape [None,28,28] as I have elements in it. Any help on how to do it?

the problem is in the shape you put. it should be [-1,28,28] format.

So your code will be :

network = tflearn.reshape(network,[-1, 28, 28])

Regards

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM