Skip to content

CNTK model format

Zhou Wang edited this page Nov 18, 2016 · 12 revisions

CNTK allows users to save a model into a file for future use. It can be done by

There are two different file formats to store the model in.

  • The model-v1 format. The model was originally used prior to the CNTK2 version. A model is stored in the model-v1 format when it is saved

    • by BrainScript/cntk.exe, or
    • by save_model() in python, when the parameter use_legacy_format is true (default value), or
    • by SaveModel() in C++, when the parameter useLegacyModelFormat is true (default value).
  • The model-v2 format. With CNTK2 a Protobuf based format is introduced, which is now known as the model-V2 format. A model is saved in this format only when using CNTK Library API

    • by save_model() in python, when the parameter use_legacy_format is false, or
    • by SaveModel() in C++, when the parameter useLegacyModelFormat is false (default value).

The following table gives an overview about which model format is created and consumed by which CNTK binary.

Model Creation Model Evaluation Lanugage Support
model-v1 format BrainScript/cntk.exe; CNTK Library EvalDll(./EvalDLL-Evaluation-Overview), CNTK-Library C++, C#, Nuget Package
model-v2 format CNTK Library CNTK-Library C++, Python
Clone this wiki locally