提交 f5f7ac00 编写于 作者: Z zhengya01

add ce

上级 85197084
......@@ -94,6 +94,14 @@ class Model(object):
return [avg_cost, accuracy]
def run(self):
if FLAGS.enable_ce:
import random
SEED = 102
random.seed(SEED)
np.random.seed(SEED)
fluid.default_main_program().random_seed = SEED
fluid.default_startup_program().random_seed = SEED
train_files = reader.train10()
test_files = reader.test10()
......
......@@ -82,8 +82,6 @@ def preprocess(sample, is_training):
img = (img_float - mean) / std
if is_training and FLAGS.cutout:
if FLAGS.enable_ce:
np.random.seed(0)
center = np.random.randint(image_size, size=2)
offset_width = max(0, center[0] - half_length)
offset_height = max(0, center[1] - half_length)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册