Skip to content
This repository has been archived by the owner on Jul 17, 2024. It is now read-only.

Commit

Permalink
Merged PR 737: logging fix to re-enable running the importers or wrap…
Browse files Browse the repository at this point in the history
….py standalone

This contains @<clovett@microsoft.com> 's fix to enable running the importers or wrap.py standalone again.
  • Loading branch information
Lisa Ong committed Jan 19, 2018
1 parent a60bf80 commit ca56996
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion tools/importers/CNTK/cntk_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import argparse
import os
import sys

import logging
import cv2
import numpy as np

Expand Down
2 changes: 1 addition & 1 deletion tools/importers/darknet/darknet_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import json
import os
import sys

import logging
import numpy as np
import cv2

Expand Down
1 change: 1 addition & 0 deletions tools/utilities/pitest/drivetest.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
##
####################################################################################################

import logging
import os
from os.path import basename
import sys
Expand Down
11 changes: 6 additions & 5 deletions tools/wrap/wrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
import sys
from shutil import copyfile

sys.path += ["../utilities/pythonlibs"]
__script_path = os.path.dirname(os.path.abspath(__file__))

sys.path += [os.path.join(__script_path, "..", "utilities", "pythonlibs")]
import find_ell
import buildtools
import logger
Expand Down Expand Up @@ -71,7 +73,7 @@ def parse_command_line(self, args=None):
# optional arguments
arg_parser.add_argument("--language", "-lang", help="the language for the ELL module", choices=["python", "cpp"], default=self.language)
arg_parser.add_argument("--target", "-target", help="the target platform", choices=["pi3", "pi0", "orangepi0", "pi3_64", "aarch64", "host"], default=self.target)
arg_parser.add_argument("--modulename", "-modulename", help="the name of the output module (by default, the same as the name of the model file)", default=None)
arg_parser.add_argument("--module_name", "-module_name", help="the name of the output module (by default, the same as the name of the model file)", default=None)
arg_parser.add_argument("--outdir", "-outdir", help="the output directory")
arg_parser.add_argument("--profile", "-profile", help="enable profiling functions in the ELL module", action="store_true")
arg_parser.add_argument("--verbose", "-v", help="print verbose output", action="store_true")
Expand All @@ -90,9 +92,8 @@ def parse_command_line(self, args=None):
self.model_file = args.model_file
_, tail = os.path.split(self.model_file)
self.model_file_base = os.path.splitext(tail)[0]
if args.modulename:
self.model_name = args.modulename
else:
self.model_name = args.module_name
if not self.model_name:
self.model_name = self.model_file_base
self.language = args.language
self.target = args.target
Expand Down

0 comments on commit ca56996

Please sign in to comment.