Giter Club home page Giter Club logo

tensorflow-mnist-predict's People

Contributors

bvolpato avatar canasta avatar lambda-zhang avatar navivanuva avatar niektemme avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tensorflow-mnist-predict's Issues

local variable 'nheigth' referenced before assignment

Hi, thanks you for sharing. I ran the code. It gives me an error

local variable 'nheigth' referenced before assignment

I run it by using:
(tensorflow)xu@xu-ThinkCentre-M72e:~ $ python Predict.py 'HandWrittenDigit2.png'
I tensorflow/stream_executor/dso_loader.cc:105] successfully opened CUDA library libcublas.so locally
I tensorflow/stream_executor/dso_loader.cc:105] successfully opened CUDA library libcudnn.so locally
I tensorflow/stream_executor/dso_loader.cc:105] successfully opened CUDA library libcufft.so locally
I tensorflow/stream_executor/dso_loader.cc:105] successfully opened CUDA library libcuda.so.1 locally
I tensorflow/stream_executor/dso_loader.cc:105] successfully opened CUDA library libcurand.so locally
Traceback (most recent call last):
File "Predict.py", line 134, in
main(sys.argv[1])
File "Predict.py", line 129, in main
imvalue = imageprepare(argv)
File "Predict.py", line 100, in imageprepare
if (nheigth == 0): #rare case but minimum is 1 pixel
UnboundLocalError: local variable 'nheigth' referenced before assignment
(tensorflow)xu@xu-ThinkCentre-M72e:~ $ python Predict.py 'HandWrittenDigit2.png'
I tensorflow/stream_executor/dso_loader.cc:105] successfully opened CUDA library libcublas.so locally
I tensorflow/stream_executor/dso_loader.cc:105] successfully opened CUDA library libcudnn.so locally
I tensorflow/stream_executor/dso_loader.cc:105] successfully opened CUDA library libcufft.so locally
I tensorflow/stream_executor/dso_loader.cc:105] successfully opened CUDA library libcuda.so.1 locally
I tensorflow/stream_executor/dso_loader.cc:105] successfully opened CUDA library libcurand.so locally
Traceback (most recent call last):
File "Predict.py", line 133, in
main(sys.argv[1])
File "Predict.py", line 128, in main
imvalue = imageprepare(argv)
File "Predict.py", line 99, in imageprepare
if (nheigth == 0): #rare case but minimum is 1 pixel
UnboundLocalError: local variable 'nheigth' referenced before assignment
(tensorflow)xu@xu-ThinkCentre-M72e:~ $

variable name "nheigth"is wrong?

Your work helps me, but i think the variable name "nheigth" is wrong , it should be "nheight". You can find it in line 76/77 of predict_1.py and line 116/117 of predict_2.py.

How to load multiple images ?

(working on predict_2.py)

How can I give multiple images at once ?
How can I visualize the final result of this in console ?
How can I print/save the multiple digits in a file (example .txt) ?

When I use predict_2.py with a BP neural network model, why can not get a accuracy like train accuracy?

this is code:
def predictint(imvalue):

     with tf.Graph().as_default():
      def addlayer(input_data,insize,outsize,act_function=None):
            W=tf.Variable(tf.random_normal([insize,outsize]))
            b=tf.Variable(tf.zeros([outsize]))+0.1
            out_data=tf.matmul(input_data,W)+b
            if act_function==None:
	         return out_data
            elif act_function=="relu":
	         return tf.nn.relu(out_data)
            elif act_function=="softmax":
	          return tf.nn.softmax(out_data)
           else:
	          return tf.nn.sigmoid(out_data)
           x_input=tf.placeholder(tf.float32,[None,784])
          #y_input=tf.placeholder(tf.float32,[None,10])
           l1=addlayer(x_input,784,64,act_function="relu")
           l2=addlayer(l1,64,10,act_function="softmax")	    
          init_op = tf.initialize_all_variables()
          saver = tf.train.Saver()	    
    
              with tf.Session() as sess:
	         sess.run(init_op)
	         saver.restore(sess, "./model.ckpt")
                 prediction=tf.argmax(l2,1)
	         return prediction.eval(feed_dict={x_input: [imvalue]}, session=sess)

Can't create the beginner create model

I'm using Mac 10.13.3 Python 3.6.2 and i just installed tensorflow via pip.And i also installed relevant dependencies using pip.But when i ran the create_model_1.py some strange error happened. Below is the problems .Hope someone can help.
2018-03-11 10 22 26

create_model

Hello there,

I am getting this error :
ValueError : Parent directory of model.ckpt doesn't exist, can't save.

With regards

Can't save the model

Hello,

I'm trying your scripts, but i can predict any numbers because when i run create_model1 or create_model2. They finish because they can't save the model.
Here the error code :

Traceback (most recent call last):
File "create_model_1.py", line 61, in <module>
save_path = saver.save(sess, "model1.ckpt"')
File "C:\Users\Laura\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\python\training\saver.py", line 1365, in save
"Parent directory of {} doesn't exist, can't save.".format(save_path))
ValueError: Parent directory of model1.ckpt doesn't exist, can't save.

Thanks.
Jordan

problem in restor

I use spyder for run create_model_2.py and then used the predict_2. but it's get error with restore.
I closed spyder and run predict_2 , this time it is run correct but then i want to run it make error with restore again I closed spyder and open it and it run correct.
what is the problem?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.