We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
this is code:
def predictint(imvalue):
The text was updated successfully, but these errors were encountered: