提交 2a1124c6 编写于 作者: B baiyfbupt

model ce

上级 a85a6014
......@@ -5,7 +5,7 @@ export CUDA_VISIBLE_DEVICES=$cudaid
if [ ! -d "/root/.cache/paddle/dataset/pascalvoc" ];then
mkdir -p /root/.cache/paddle/dataset/pascalvoc
#./data/pascalvoc/download.sh
./data/pascalvoc/download.sh
cp -r ./data/pascalvoc/. /home/.cache/paddle/dataset/pascalvoc
fi
FLAGS_benchmark=true python train.py --for_model_ce=True --batch_size=64 --num_passes=2 --data_dir=/root/.cache/paddle/dataset/pascalvoc/ | python _ce.py
......@@ -174,8 +174,6 @@ def train(args,
test_map = np.mean(every_test_map)
return (train_map, test_map)
train_num = 0
total_train_time = 0.0
for pass_id in range(num_passes):
start_time = time.time()
prev_start_time = start_time
......@@ -196,17 +194,16 @@ def train(args,
feed=feeder.feed(data),
fetch_list=[loss])
loss_v = np.mean(np.array(loss_v))
every_pass_loss.append(loss_v)
if batch_id % 20 == 0:
print("Pass {0}, batch {1}, loss {2}, time {3}".format(
pass_id, batch_id, loss_v, start_time - prev_start_time))
end_time = time.time()
every_pass_loss.append(loss_v)
total_train_time += pass_duration
train_avg_loss = np.mean(every_pass_loss)
best_map = test(pass_id, best_map)
if args.for_model_ce:
train_avg_loss = np.mean(every_pass_loss)
train_avg_acc, test_avg_acc = ce_map(pass_id, best_map)
print ("kpis train_acc %f" % train_avg_acc)
print ("kpis train_cost %f" % train_avg_loss)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册