forked from PythonWorkshop/TensorFlowFlask
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.py
More file actions
30 lines (23 loc) · 769 Bytes
/
test.py
File metadata and controls
30 lines (23 loc) · 769 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# restore trained data
import tensorflow as tf
import sys
from wine_quality.training import train_model
import wine_quality.model as model
import json
import os
from form import TestParameterForm
x = tf.placeholder("float", [None, 10])
sess = tf.Session()
dataframe = pd.read_csv('data/winequality-red.csv', sep=';')
train_model(dataframe)
with tf.variable_scope("softmax_regression"):
y1, variables = model.softmax_regression(x)
saver = tf.train.Saver(variables)
saver.restore(sess, "wine_quality/data/softmax_regression.ckpt")
def simple(x1):
return sess.run(y1, feed_dict={x: x1})
x1 = [[0.7, 0, 1.9, 0.076, 11, 34, 0.99780, 3.51, 0.56, 9.4],
[0.65, 0, 1.2, 0.065, 15.0, 21, 0.9946, 3.39, 0.47, 10]]
print(simple(x1))
print(y1)
print(variables)