loaded_models = [] for i in range(1, 5): name = "Model_" + str(i) + ".json" h5name = "Model_" + str(i) + "_weights.h5" json_file = open(name, 'r') loaded_model_json = json_file.read() json_file.close() loaded_model = model_from_json(loaded_model_json) loaded_model.load_weights(h5name) loaded_models.append(loaded_model)
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter