mnist

Can I use cv2.cvtColor(image,cv2.COLOR_GRAY2RGB) on a batch of data?

霸气de小男生 提交于 2019-12-11 17:18:56
问题 I am working with Inception v3, trying to use MNIST JPG images as the dataset to predict. I am running into a problem when its time to input training batches into the model. The error is because of the shape. X_batch produces a shape of (?,299,299), where as the first layer needs a shape of (?, 299, 299, 3). In a different part of my code that displaces a few examples I was able to use example_image = cv2.cvtColor(example_image,cv2.COLOR_GRAY2RGB) to convert the examples into RGB which gave

High training accuracy but low prediction performance for Tensorflow's official MNIST model

陌路散爱 提交于 2019-12-11 15:51:44
问题 I'm new to machine learning and I was following along with the Tensorflow official MNIST model (https://github.com/tensorflow/models/tree/master/official/mnist). After training the model for 3 epochs and getting accuracy results of over 98%, I decided to test the dataset with some of my own handwritten images that are very close to those found in the MNIST dataset: {'loss': 0.03686057, 'global_step': 2400, 'accuracy': 0.98729998} handwritten 1, predicted as 2: https://storage.googleapis.com

What's the difference between keras.datasets.mnist and tensorflow.examples.tutorials.mnist?

左心房为你撑大大i 提交于 2019-12-11 06:06:02
问题 I am analysing this DCGAN. When I use input_data from tensorflow.examples.tutorials.mnist , as seen in line 144: self.x_train = input_data.read_data_sets("mnist",\ one_hot=True).train.images I obtain reasonably good results: Though when I use mnist from keras.datasets and the 144th line looks like this: (xtr, ytr), (xte, yte) = mnist.load_data(); self.x_train = xtr I get horribly bad results: I have checked manually a few images from both datasets and they are quite similar. So what is the

Windows Tensorflow with Python unable to read mnist data due to permissions

拥有回忆 提交于 2019-12-11 05:55:27
问题 I'm using Python on windows and am following the standard tutorial for Tensorflow that requires reading the MNIST data set. Unfortunately I get the following error when trying to run: PermissionError: [Errno 13] Permission denied: 'C:\Users\matth\AppData\Local\Temp\tmp6_cvro98' That filename at the end changes each time the program runs. The code in question is: import tensorflow as tf from tensorflow.contrib.learn.python.learn.datasets import mnist as input_data mnist = input_data.read_data

TensorFlow - Training accuracy not improving in MNIST data

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-11 05:47:46
问题 I write a program with tensorflow to process Kaggle's digit-recognizer problem.Program can run normally,but the training accuracy is always low,about 10%,such as following : step 0, training accuracy 0.11 step 100, training accuracy 0.13 step 200, training accuracy 0.21 step 300, training accuracy 0.12 step 400, training accuracy 0.07 step 500, training accuracy 0.08 step 600, training accuracy 0.15 step 700, training accuracy 0.05 step 800, training accuracy 0.08 step 900, training accuracy

OCR目标识别

半城伤御伤魂 提交于 2019-12-11 00:37:20
先抱怨一句,识别真的比检测难很多呀,文字识别可根据待识别的文字特点采用不同的识别方法,一般分为定长文字、不定长文字两大类别。 定长文字: 定长字符识别中比较广泛的几个例子就是:MNIST识别,验证码识别,车牌识别。 MNIST: MNIST这个感觉实在是没啥说的,拿出一本深度学习入门书籍,可能实战篇就有这个项目,无论什么深度学习框架上网搜,都能搜出一大堆程序。 验证码识别: 验证码这一块,现成的代码也比较多了,文章这一块我参考了 https://my.oschina.net/u/876354/blog/3048523 ,代码这一块我参考了 https://github.com/nickliqian/cnn_captcha 。 车牌识别: 无,虽然现在车牌识别的产品已经很多了,但是网上基本没有开源的项目。我试过搜索一些论文和博客,感觉很多都是让你测效果,如何做出来的,网络结构这一块,没有找到,打开就是我做的车牌多准多准这样。 不定长文字识别: 不定长文字识别是目前OCR识别研究方向的主流,一些论文啥的也比较多,我做的不是这个方向,所以只是简单浏览了一下,看看有没有什么能用的,并没有深入调研,如果研究这个方向的可以参考这篇总结: https://github.com/hwalsuklee/awesome-deep-text-detection-recognition

tf.keras loss becomes NaN

喜夏-厌秋 提交于 2019-12-10 17:21:33
问题 I'm programming a neural network in tf.keras, with 3 layers. My dataset is the MNIST dataset. I decreased the number of examples in the dataset, so the runtime is lower. This is my code: import tensorflow as tf from tensorflow.keras import layers import numpy as np import pandas as pd !git clone https://github.com/DanorRon/data %cd data !ls batch_size = 32 epochs = 10 alpha = 0.0001 lambda_ = 0 h1 = 50 train = pd.read_csv('/content/first-repository/mnist_train.csv.zip') test = pd.read_csv('

Hard to understand Caffe MNIST example

心不动则不痛 提交于 2019-12-10 15:23:11
问题 After going through the Caffe tutorial here: http://caffe.berkeleyvision.org/gathered/examples/mnist.html I am really confused about the different (and efficient) model using in this tutorial, which is defined here: https://github.com/BVLC/caffe/blob/master/examples/mnist/lenet_train_test.prototxt As I understand, Convolutional layer in Caffe simply calculate the sum of Wx+b for each input, without applying any activation function. If we would like to add the activation function, we should

神经网络之MNIST数据集和CIFAR-10数据集训练

别等时光非礼了梦想. 提交于 2019-12-09 15:17:09
1.构建前馈神经网络训练MNIST 环境 :pycharm + win10 + conda3 + python3.6 首先创建一个神经网络类NeuralNetwork: import numpy as np #定义一个神经网络类 class NeuralNetwork : #初始化参数 def __init__ ( self , layers , alpha = 0.1 ) : self . Weight = [ ] self . layers = layers self . alpha = alpha #遍历从第一层到最后两层之前停止 for i in np . arange ( 0 , len ( layers ) - 2 ) : #构造MxN权重矩阵,节点相连,增加一个偏置项,正态化数据:除以当前层节点数平方根,得稳定方差 weight = np . random . randn ( layers [ i ] + 1 , layers [ i + 1 ] + 1 ) self . Weight . append ( weight / np . sqrt ( layers [ i ] ) ) #最后两层输入连接需要一个偏置项,输入不需要 weight = np . random . randn ( layers [ - 2 ] + 1 , layers [ - 1 ] )

Display MNIST image using matplotlib [duplicate]

≡放荡痞女 提交于 2019-12-09 12:33:43
问题 This question already has answers here : TensorFlow - Show image from MNIST DataSet (5 answers) Closed last year . I am using tensorflow to import some MNIST input data. I followed this tutorial...https://www.tensorflow.org/get_started/mnist/beginners I am importing them as so... from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_sets("/tmp/data/", one_hot=True) I want to be able to display any of the images from the training set. I know the location of