Skip to content

Commit

Permalink
fix bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
kpedro88 committed Jan 7, 2019
1 parent 1d74c53 commit f3d96e2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
14 changes: 4 additions & 10 deletions AnalysisFW/python/configure_aml.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def define_model(model_name,verbose=False):

# Featurizer
model_path = os.path.expandvars('$CMSSW_BASE/src/SonicCMS/AnalysisFW/python')
model = QuantizedResNet50(model_path, is_frozen = True)
model = QuantizedResnet50(model_path, is_frozen = True)
if verbose: print(model.version)

# Classifier
Expand All @@ -42,7 +42,7 @@ def define_model(model_name,verbose=False):
if verbose: print(model.classifier_input.shape)

# service definition
from amlrealtimeai.pipeline import ServiceDefinition, TensorflowStage, BrainWaveStage
from azureml.contrib.brainwave.pipeline import ModelDefinition, TensorflowStage, BrainWaveStage

save_path = model_path
model_def_path = os.path.join(save_path, 'model_def_'+model_name+'.zip')
Expand All @@ -57,7 +57,6 @@ def define_model(model_name,verbose=False):
return model_def_path

parser = OptionParser()
parser.add_option("-w", "--workspace", dest="workspace", default="workspace.json", help="name of workspace json file (default = %default)")
parser.add_option("-p", "--params", dest="params", default="service_model_params.json", help="name of service & model params output json file (default = %default)")
parser.add_option("-m", "--model", dest="model", default="", help="use model with provided name (default = %default)")
parser.add_option("-r", "--recreate", dest="recreate", default=False, action="store_true", help="recreate model (instead of use existing model)")
Expand All @@ -74,13 +73,8 @@ def define_model(model_name,verbose=False):
resource_group = "CMS_FPGA_Resources"
workspace_name = "Fermilab"

if os.path.isfile(options.workspace):
# get workspace from json
ws = Workspace.from_config(path=options.workspace)
else:
# create workspace, save json for later
ws = Workspace(subscription_id = subscription_id, resource_group = resource_group, workspace_name = workspace_name)
ws.write_config(options.workspace)
# create workspace, save json for later
ws = Workspace(subscription_id = subscription_id, resource_group = resource_group, workspace_name = workspace_name)

model_name = options.model
service_name = options.service
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ that depend on them (to avoid confusion between the CMSSW and `miniconda` enviro

The script `configure_aml.py` is used to create and register a model and start the associated service. The options of this script are:
* `-h`, `--help`: show this help message and exit
* `-w WORKSPACE`, `--workspace=WORKSPACE`: name of workspace json file (default = workspace.json)
* `-p PARAMS`, `--params=PARAMS`: name of service & model params output json file (default = service_model_params.json)
* `-m MODEL`, `--model=MODEL`: use model with provided name (default = )
* `-r`, `--recreate`: recreate model (instead of use existing model)
Expand Down

0 comments on commit f3d96e2

Please sign in to comment.