Skip to content
Snippets Groups Projects
Commit 80341470 authored by zhouneng's avatar zhouneng
Browse files

clean code

parent d0d28449
No related branches found
No related tags found
No related merge requests found
......@@ -161,7 +161,6 @@ anno_path: ''
backbone: 'resnet_v1.5_50'
# eval.py FasterRcnn evaluation
ann_file: '/cache/data/annotations/instances_val2017.json'
checkpoint_path: "/cache/train/fasterrcnn/faster_rcnn-12_7393.ckpt"
# export.py fasterrcnn_export
......@@ -170,7 +169,6 @@ file_format: "MINDIR"
ckpt_file: "/cache/train/fasterrcnn/faster_rcnn-12_7393.ckpt"
# postprocess ("./src/config_50.yaml")
#ann_file: ''
result_path: ''
---
......@@ -199,7 +197,6 @@ device_id: 'Device id, default is 0.'
device_num: 'Use device nums, default is 1.'
rank_id: 'Rank id, default is 0.'
file_format: 'file format'
ann_file: "Ann file, default is val.json."
checkpoint_path: "Checkpoint file path."
ckpt_file: 'fasterrcnn ckpt file.'
result_path: "result file path."
......
......@@ -162,7 +162,6 @@ anno_path: ''
backbone: 'resnet_v1_101'
# eval.py FasterRcnn evaluation
ann_file: '/cache/data/annotations/instances_val2017.json'
checkpoint_path: "/cache/train/fasterrcnn/faster_rcnn-12_7393.ckpt"
# export.py fasterrcnn_export
......@@ -171,7 +170,6 @@ file_format: "MINDIR"
ckpt_file: "/cache/train/fasterrcnn/faster_rcnn-12_7393.ckpt"
# postprocess ("./src/config_50.yaml")
#ann_file: ''
result_path: ''
---
......@@ -200,7 +198,6 @@ device_id: 'Device id, default is 0.'
device_num: 'Use device nums, default is 1.'
rank_id: 'Rank id, default is 0.'
file_format: 'file format'
ann_file: "Ann file, default is val.json."
checkpoint_path: "Checkpoint file path."
ckpt_file: 'fasterrcnn ckpt file.'
result_path: "result file path."
......
......@@ -162,7 +162,6 @@ anno_path: ''
backbone: 'resnet_v1_152'
# eval.py FasterRcnn evaluation
ann_file: '/cache/data/annotations/instances_val2017.json'
checkpoint_path: "/cache/train/fasterrcnn/faster_rcnn-12_7393.ckpt"
# export.py fasterrcnn_export
......@@ -171,7 +170,6 @@ file_format: "MINDIR"
ckpt_file: "/cache/train/fasterrcnn/faster_rcnn-12_7393.ckpt"
# postprocess ("./src/config_50.yaml")
#ann_file: ''
result_path: ''
---
......@@ -200,7 +198,6 @@ device_id: 'Device id, default is 0.'
device_num: 'Use device nums, default is 1.'
rank_id: 'Rank id, default is 0.'
file_format: 'file format'
ann_file: "Ann file, default is val.json."
checkpoint_path: "Checkpoint file path."
ckpt_file: 'fasterrcnn ckpt file.'
result_path: "result file path."
......
......@@ -160,7 +160,6 @@ anno_path: ''
backbone: 'inception_resnet_v2'
# eval.py FasterRcnn evaluation
ann_file: '/cache/data/annotations/instances_val2017.json'
checkpoint_path: "/cache/checkpoint_path/faster_rcnn-20_7393.ckpt"
# export.py fasterrcnn_export
......@@ -169,7 +168,6 @@ file_format: "MINDIR"
ckpt_file: ""
# postprocess ("./src/default_config_InceptionResnetV2.yaml")
#ann_file: ''
result_path: ''
---
......@@ -198,7 +196,6 @@ device_id: 'Device id, default is 0.'
device_num: 'Use device nums, default is 1.'
rank_id: 'Rank id, default is 0.'
file_format: 'file format'
ann_file: "Ann file, default is val.json."
checkpoint_path: "Checkpoint file path."
ckpt_file: 'fasterrcnn ckpt file.'
result_path: "result file path."
......
......@@ -31,14 +31,14 @@ def modelarts_pre_process():
@moxing_wrapper(pre_process=modelarts_pre_process)
def get_eval_result(ann_file, result_path):
def get_eval_result(anno_path, result_path):
""" get evaluation result of faster rcnn"""
max_num = 128
result_path = result_path
outputs = []
dataset_coco = COCO(ann_file)
dataset_coco = COCO(anno_path)
img_ids = dataset_coco.getImgIds()
for img_id in img_ids:
......@@ -74,4 +74,4 @@ def get_eval_result(ann_file, result_path):
if __name__ == '__main__':
get_eval_result(config.ann_file, config.result_path)
get_eval_result(config.anno_path, config.result_path)
......@@ -168,9 +168,8 @@ def run_train():
neg_gnew_neighs)
if iter_num == num_iter:
print('Epoch', '%03d' % _epoch, 'iter', '%02d' % iter_num,
'loss',
'{}, cost:{:.4f}'.format(train_loss, time.time() - epoch_start))
print('Epoch: {}, iter: {}, loss: {}, epoch time: {:.4f}, per step time: {:.4f}'.format(
_epoch, iter_num, train_loss, time.time() - epoch_start, (time.time()-epoch_start) / num_iter))
iter_num += 1
if _epoch % config.eval_interval == 0:
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment