Skip to content

How do I Read Things in Python

Chris Basoglu edited this page Apr 6, 2017 · 4 revisions

Load model and access network weights (parameters)

Load model and access network weights (parameters)

You have trained and saved a model file. Now you want to load it elsewhere and get the parameters. Here are the steps you need to follow:

    loaded_model = load_model("model_file_path")
    if is_BrainScript: 
        loaded_model = combine([loaded_model.outputs[0]])

    parameters = loaded_model.parameters
    for parameter in parameters:
        print(parameter.name, parameter.shape, "\n", parameter.value) 
Clone this wiki locally