Update app.py
Browse files
app.py
CHANGED
|
@@ -18,6 +18,7 @@ sess = tf.compat.v1.Session()
|
|
| 18 |
from keras import backend as K
|
| 19 |
K.set_session(sess)
|
| 20 |
|
|
|
|
| 21 |
|
| 22 |
# Do you want it loud?
|
| 23 |
VERBOSE = 1
|
|
@@ -87,7 +88,8 @@ class Network(object):
|
|
| 87 |
other_data_input = data_input.reshape((self.G, self.G, self.G), order='F')
|
| 88 |
|
| 89 |
# Get the outputs
|
| 90 |
-
|
|
|
|
| 91 |
true_output = self.new_curves[idx].reshape((3, self.F))
|
| 92 |
predicted_output = predicted_output.reshape((3, self.F))
|
| 93 |
|
|
@@ -112,7 +114,8 @@ class Network(object):
|
|
| 112 |
other_data_input = data_input.reshape((3, self.F))
|
| 113 |
|
| 114 |
# Get the outputs
|
| 115 |
-
|
|
|
|
| 116 |
true_output = self.new_geometry[idx].reshape((self.G, self.G, self.G), order='F')
|
| 117 |
predicted_output = predicted_output.reshape((self.G, self.G, self.G), order='F')
|
| 118 |
|
|
@@ -125,7 +128,8 @@ class Network(object):
|
|
| 125 |
data_input = other_data_input.reshape((1, 3*self.F))
|
| 126 |
|
| 127 |
# Get the outputs
|
| 128 |
-
|
|
|
|
| 129 |
predicted_output = predicted_output.reshape((self.G, self.G, self.G), order='F')
|
| 130 |
|
| 131 |
# return idx, other_data_input, true_output, predicted_output
|
|
|
|
| 18 |
from keras import backend as K
|
| 19 |
K.set_session(sess)
|
| 20 |
|
| 21 |
+
graph = tf.get_default_graph()
|
| 22 |
|
| 23 |
# Do you want it loud?
|
| 24 |
VERBOSE = 1
|
|
|
|
| 88 |
other_data_input = data_input.reshape((self.G, self.G, self.G), order='F')
|
| 89 |
|
| 90 |
# Get the outputs
|
| 91 |
+
with graph.as_default():
|
| 92 |
+
predicted_output = self.network.predict(data_input)
|
| 93 |
true_output = self.new_curves[idx].reshape((3, self.F))
|
| 94 |
predicted_output = predicted_output.reshape((3, self.F))
|
| 95 |
|
|
|
|
| 114 |
other_data_input = data_input.reshape((3, self.F))
|
| 115 |
|
| 116 |
# Get the outputs
|
| 117 |
+
with graph.as_default():
|
| 118 |
+
predicted_output = self.network.predict(data_input)
|
| 119 |
true_output = self.new_geometry[idx].reshape((self.G, self.G, self.G), order='F')
|
| 120 |
predicted_output = predicted_output.reshape((self.G, self.G, self.G), order='F')
|
| 121 |
|
|
|
|
| 128 |
data_input = other_data_input.reshape((1, 3*self.F))
|
| 129 |
|
| 130 |
# Get the outputs
|
| 131 |
+
with graph.as_default():
|
| 132 |
+
predicted_output = self.network.predict(data_input)
|
| 133 |
predicted_output = predicted_output.reshape((self.G, self.G, self.G), order='F')
|
| 134 |
|
| 135 |
# return idx, other_data_input, true_output, predicted_output
|