bugfix on argpasr for bool

This commit is contained in:
gengdongjie 2020-08-29 10:07:12 +08:00
parent 1821e98e07
commit a99bc1a9b0
16 changed files with 12 additions and 11 deletions

View File

@ -50,7 +50,7 @@ MaskRcnn is a two-stage target detection network,This network uses a region prop
```shell
.
└─MaskRcnn
└─maskrcnn
├─README.md
├─scripts
├─run_download_process_data.sh
@ -58,7 +58,7 @@ MaskRcnn is a two-stage target detection network,This network uses a region prop
├─run_train.sh
└─run_eval.sh
├─src
├─MaskRcnn
├─maskrcnn
├─__init__.py
├─anchor_generator.py
├─bbox_assign_sample.py

View File

@ -24,7 +24,7 @@ from mindspore import context, Tensor
from mindspore.train.serialization import load_checkpoint, load_param_into_net
import mindspore.dataset.engine as de
from src.MaskRcnn.mask_rcnn_r50 import Mask_Rcnn_Resnet50
from src.maskrcnn.mask_rcnn_r50 import Mask_Rcnn_Resnet50
from src.config import config
from src.dataset import data_to_mindrecord_byte_image, create_maskrcnn_dataset
from src.util import coco_eval, bbox2result_1image, results2json, get_seg_masks

View File

@ -141,8 +141,8 @@ config = ed({
"keep_checkpoint_max": 12,
"save_checkpoint_path": "./checkpoint",
"mindrecord_dir": "/home/mxw/mask_rcnn/scripts/MindRecord_COCO2017_Train",
"coco_root": "/home/mxw/coco2017/",
"mindrecord_dir": "/home/mask_rcnn/MindRecord_COCO2017_Train",
"coco_root": "/home/mask_rcnn/coco2017/",
"train_data_type": "train2017",
"val_data_type": "val2017",
"instance_set": "annotations/instances_{}.json",

View File

@ -18,6 +18,7 @@
import os
import argparse
import random
import ast
import numpy as np
import mindspore.common.dtype as mstype
@ -30,7 +31,7 @@ from mindspore.train.serialization import load_checkpoint, load_param_into_net
from mindspore.nn import SGD
import mindspore.dataset.engine as de
from src.MaskRcnn.mask_rcnn_r50 import Mask_Rcnn_Resnet50
from src.maskrcnn.mask_rcnn_r50 import Mask_Rcnn_Resnet50
from src.network_define import LossCallBack, WithLossCell, TrainOneStepCell, LossNet
from src.config import config
from src.dataset import data_to_mindrecord_byte_image, create_maskrcnn_dataset
@ -41,11 +42,11 @@ np.random.seed(1)
de.config.set_seed(1)
parser = argparse.ArgumentParser(description="MaskRcnn training")
parser.add_argument("--only_create_dataset", type=bool, default=False, help="If set it true, only create "
"Mindrecord, default is false.")
parser.add_argument("--run_distribute", type=bool, default=False, help="Run distribute, default is false.")
parser.add_argument("--do_train", type=bool, default=True, help="Do train or not, default is true.")
parser.add_argument("--do_eval", type=bool, default=False, help="Do eval or not, default is false.")
parser.add_argument("--only_create_dataset", type=ast.literal_eval, default=False, help="If set it true, only create "
"Mindrecord, default is false.")
parser.add_argument("--run_distribute", type=ast.literal_eval, default=False, help="Run distribute, default is false.")
parser.add_argument("--do_train", type=ast.literal_eval, default=True, help="Do train or not, default is true.")
parser.add_argument("--do_eval", type=ast.literal_eval, default=False, help="Do eval or not, default is false.")
parser.add_argument("--dataset", type=str, default="coco", help="Dataset, default is coco.")
parser.add_argument("--pre_trained", type=str, default="", help="Pretrain file path.")
parser.add_argument("--device_id", type=int, default=0, help="Device id, default is 0.")