def __init__(self, is_remote): self.url = US.get_url_job(is_remote)
try: id_job = int(sys.argv[1]) #1606147964029 except: exit("ERROR: Please insert a valid numeric job id.") username = "******" is_remote = False try: is_remote = (sys.argv[2].lower() == 'true') print("REMOTE HOST") except: print("LOCAL HOST") # LOAD JOB url_job = US.get_url_job(is_remote) job_json = load_job(url_job, id_job) # LOAD MODEL TOPOLOGY url_topology = US.get_url_topology(job_json, is_remote) model_topology_key = job_json["topology"]["topology"] mymodel = load_model_topology_http(url_topology, model_topology_key, id_job, username) mymodel.summary() ### LOADING DATA X_train, Y_train, X_test, Y_test = loader(job_json) ################### ### LOAD MODEL OLD WEIGHTS '''
from src.api.load_job import load_job from src.api.delete_job import delete_job from src.helper import url_solver as US from src.nn.topology import create_topology_mnist_28_28_1 id_job = None try: id_job = int(sys.argv[1]) #1234567890 print(id_job) except: exit("ERROR: Please insert a valid numeric job id.") username = "******" # LOAD JOB url_job = US.get_url_job() job_json = load_job(url_job, id_job) model = create_topology_mnist_28_28_1() print(model.layers) print(type(model.layers)) print(model.layers[0].name) names = [weight.name for layer in model.layers for weight in layer.weights] weights = model.get_weights() names = list(map(lambda x: x[0:x.index(':')], names)) url_delete_job = US.get_url_delete_job() delete_job(url_delete_job, id_job)