Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def run(self, dataset_obj, model_specs, hp_values, config=None, progress=None):
download_data(dataset_obj)
# get project
project = dataset_obj.project
assert isinstance(project, dl.entities.Project)
cls = getattr(import_module('.adapter', 'zoo.' + model_specs['name']), 'AdapterModel')
final = 1
devices = {'gpu_index': 0}
adapter = cls(devices, model_specs, hp_values, final)
if hasattr(adapter, 'reformat'):
adapter.reformat()
if hasattr(adapter, 'data_loader'):
adapter.data_loader()
if hasattr(adapter, 'preprocess'):
adapter.preprocess()
if hasattr(adapter, 'build'):
adapter.build()
adapter.train()
def run(self, dataset, configs=None, progress=None):
project = dataset.project
assert isinstance(project, dl.entities.Project)
pipeline_id = str(uuid.uuid1())
local_path = os.path.join(os.getcwd(), pipeline_id)
#######################
# download for resume #
#######################
project.artifacts.download(plugin_name='tuner',
session_id=pipeline_id,
local_path=local_path)
# start tune
# deploy trainers
trainer_deployment = project.deployments.get(deployment_name='trainer')
for i in range(5):
trainer_deployment.sessions.create()