提交 e4c1fc09 编写于 作者: B BigFishMaster

limit column number to 80

上级 ee97ec62
...@@ -71,7 +71,7 @@ def bottleneck_block(input, num_filters, stride, cardinality, reduction_ratio): ...@@ -71,7 +71,7 @@ def bottleneck_block(input, num_filters, stride, cardinality, reduction_ratio):
def SE_ResNeXt(input, class_dim, infer=False, layers=50): def SE_ResNeXt(input, class_dim, infer=False, layers=50):
supported_layers = [50, 152] supported_layers = [50, 152]
if layers not in supported_layers: if layers not in supported_layers:
print("supported layers are", supported_layers, "but input layer is ", print("supported layers are", supported_layers, "but input layer is",
layers) layers)
exit() exit()
if layers == 50: if layers == 50:
...@@ -216,10 +216,11 @@ def train(learning_rate, ...@@ -216,10 +216,11 @@ def train(learning_rate,
train_info[1].append(acc1[0]) train_info[1].append(acc1[0])
train_info[2].append(acc5[0]) train_info[2].append(acc5[0])
if batch_id % 10 == 0: if batch_id % 10 == 0:
print( print("Pass {0}, trainbatch {1}, loss {2}, \
"Pass {0}, trainbatch {1}, loss {2}, acc1 {3}, acc5 {4} time {5}". acc1 {3}, acc5 {4} time {5}"
format(pass_id, batch_id, loss[0], acc1[0], acc5[0], .format(pass_id, \
"%2.2f sec" % period)) batch_id, loss[0], acc1[0], acc5[0], \
"%2.2f sec" % period))
sys.stdout.flush() sys.stdout.flush()
train_loss = np.array(train_info[0]).mean() train_loss = np.array(train_info[0]).mean()
...@@ -237,20 +238,22 @@ def train(learning_rate, ...@@ -237,20 +238,22 @@ def train(learning_rate,
test_info[1].append(acc1[0]) test_info[1].append(acc1[0])
test_info[2].append(acc5[0]) test_info[2].append(acc5[0])
if batch_id % 10 == 0: if batch_id % 10 == 0:
print( print("Pass {0}, testbatch {1}, loss {2}, \
"Pass {0}, testbatch {1}, loss {2}, acc1 {3}, acc5 {4} time {5}". acc1 {3}, acc5 {4} time {5}"
format(pass_id, batch_id, loss[0], acc1[0], acc5[0], .format(pass_id, \
"%2.2f sec" % period)) batch_id, loss[0], acc1[0], acc5[0], \
"%2.2f sec" % period))
sys.stdout.flush() sys.stdout.flush()
test_loss = np.array(test_info[0]).mean() test_loss = np.array(test_info[0]).mean()
test_acc1 = np.array(test_info[1]).mean() test_acc1 = np.array(test_info[1]).mean()
test_acc5 = np.array(test_info[2]).mean() test_acc5 = np.array(test_info[2]).mean()
print("End pass {0}, train_loss {1}, train_acc1 {2}, train_acc5 {3},\ print("End pass {0}, train_loss {1}, train_acc1 {2}, train_acc5 {3}, \
test_loss {4}, test_acc1 {5}, test_acc5 {6}" test_loss {4}, test_acc1 {5}, test_acc5 {6}"
.format(pass_id, \ .format(pass_id, \
train_loss, train_acc1, train_acc5, test_loss, test_acc1, test_acc5)) train_loss, train_acc1, train_acc5, test_loss, test_acc1, \
test_acc5))
sys.stdout.flush() sys.stdout.flush()
model_path = os.path.join(model_save_dir, str(pass_id)) model_path = os.path.join(model_save_dir, str(pass_id))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册