From f3d96e25eafa2ab9450059e1bd037219b6696b08 Mon Sep 17 00:00:00 2001 From: Kevin Pedro Date: Mon, 7 Jan 2019 11:41:19 -0600 Subject: [PATCH] fix bugs --- AnalysisFW/python/configure_aml.py | 14 ++++---------- README.md | 1 - 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/AnalysisFW/python/configure_aml.py b/AnalysisFW/python/configure_aml.py index edd4d7c..94ddc42 100644 --- a/AnalysisFW/python/configure_aml.py +++ b/AnalysisFW/python/configure_aml.py @@ -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 @@ -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') @@ -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)") @@ -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 diff --git a/README.md b/README.md index 1e0e6d1..aa7e4f1 100644 --- a/README.md +++ b/README.md @@ -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)