Skip to content

Commit

Permalink
Merge pull request #360 from WongGawa/v0.4.0
Browse files Browse the repository at this point in the history
fix yolov7's MaxPool2d's bug
  • Loading branch information
CaitinZhao authored Sep 26, 2024
2 parents a347c04 + a10dca7 commit 9141b36
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions configs/yolov7/yolov7-tiny.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ __BASE__: [
per_batch_size: 16 # 16 * 8 = 128
img_size: 640 # image sizes
sync_bn: True
precision_mode: 'allow_fp32_to_fp16'

network:
model_name: yolov7
Expand Down
5 changes: 5 additions & 0 deletions test.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ def get_parser_test(parents=None):
parser.add_argument(
"--ms_enable_graph_kernel", type=ast.literal_eval, default=False, help="use enable_graph_kernel or not"
)
parser.add_argument(
"--precision_mode", type=str, default=None, help="set accuracy mode of network model"
)
parser.add_argument("--weight", type=str, default="yolov7_300.ckpt", help="model.ckpt path(s)")
parser.add_argument("--per_batch_size", type=int, default=32, help="size of each image batch")
parser.add_argument("--img_size", type=int, default=640, help="inference size (pixels)")
Expand Down Expand Up @@ -71,6 +74,8 @@ def get_parser_test(parents=None):
def set_default_test(args):
# Set Context
ms.set_context(mode=args.ms_mode, device_target=args.device_target, max_call_depth=2000)
if args.precision_mode is not None:
ms.set_context(ascend_config={"precision_mode":args.precision_mode})
if args.ms_mode == 0:
ms.set_context(jit_config={"jit_level": "O2"})
if args.device_target == "Ascend":
Expand Down

0 comments on commit 9141b36

Please sign in to comment.