Spaces:
Running
Running
File size: 436 Bytes
c779da4 5575a7a c779da4 5575a7a |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
import keras
from keras.models import model_from_json
print("keras versio:", keras.__version__)
def load_model_from_files(json_path, weights_path):
with open(json_path, "r") as json_file:
loaded_model_json = json_file.read()
model = model_from_json(loaded_model_json)
model.load_weights(weights_path)
model.compile(optimizer='adam', loss='categorical_crossentropy', metrics=['accuracy'])
return model
|