Update app.py
Browse fileschecking if strategy causes problems
app.py
CHANGED
@@ -71,27 +71,27 @@ def run_cnn(img_arr):
|
|
71 |
return prediction
|
72 |
|
73 |
def run_effNet(img_arr):
|
74 |
-
try:
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
except ValueError:
|
80 |
-
|
81 |
-
with strategy.scope():
|
82 |
-
|
83 |
return prediction
|
84 |
|
85 |
def run_effNet_Art(img_arr):
|
86 |
-
try:
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
except ValueError:
|
92 |
-
|
93 |
-
with strategy.scope():
|
94 |
-
|
95 |
return prediction
|
96 |
|
97 |
def pre_process_img_effNet(image):
|
|
|
71 |
return prediction
|
72 |
|
73 |
def run_effNet(img_arr):
|
74 |
+
# try:
|
75 |
+
# resolver = tf.distribute.cluster_resolver.TPUClusterResolver()
|
76 |
+
# tf.config.experimental_connect_to_cluster(resolver)
|
77 |
+
# tf.tpu.experimental.initialize_tpu_system(resolver)
|
78 |
+
# strategy = tf.distribute.TPUStrategy(resolver)
|
79 |
+
# except ValueError:
|
80 |
+
# strategy = tf.distribute.get_strategy()
|
81 |
+
# with strategy.scope():
|
82 |
+
prediction = eff_net_model.predict(img_arr)
|
83 |
return prediction
|
84 |
|
85 |
def run_effNet_Art(img_arr):
|
86 |
+
# try:
|
87 |
+
# resolver = tf.distribute.cluster_resolver.TPUClusterResolver()
|
88 |
+
# tf.config.experimental_connect_to_cluster(resolver)
|
89 |
+
# tf.tpu.experimental.initialize_tpu_system(resolver)
|
90 |
+
# strategy = tf.distribute.TPUStrategy(resolver)
|
91 |
+
# except ValueError:
|
92 |
+
# strategy = tf.distribute.get_strategy()
|
93 |
+
# with strategy.scope():
|
94 |
+
prediction = eff_net_art_model.predict(img_arr)
|
95 |
return prediction
|
96 |
|
97 |
def pre_process_img_effNet(image):
|