Resize MNIST Data on Tensorflow

感情迁移 提交于 2019-12-24 07:36:57

问题


I have been working on MNIST dataset to learn how to use Tensorflow and Python for my deep learning course.

I could read the data internally/externally and also train it in softmax and cnn thanks to tensorflow tutorial at website. At the end, I could get >%90 in softmax, >%98 in cnn, accuracy.

My problem is that I want to resize all images on MNIST as 14x14 and train it again, also to augment all (noising, rotating etc.) and train again. At the end, I want to be able to compare the accuracies of these three different dataset.

Could you please help me to solve it? How to resize all images and how the model should change.

Thanks!


回答1:


One way to resize images is using the scipy resize function:

from scipy.misc import imresize
img = imresize(yourimage, (14, 14))

But my real advice to you is that should take a look at the Kadenze course "Creative applications of deep learning". This is a notebook for lecture two: https://github.com/pkmital/CADL/blob/master/session-2/lecture-2.ipynb

This course is really good at helping you understand using images and Tensorflow.



来源:https://stackoverflow.com/questions/42784809/resize-mnist-data-on-tensorflow

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!