Skip to content

CNTK Eval Examples

marhamil723 edited this page Apr 28, 2017 · 20 revisions

Eval samples in CNTK binary download package

The CNTK binary download package on the CNTK Releases page includes samples for using the eval library in C++, C#/.NET and Python.

CNTK Library Eval C++/C# Examples

The CNTKLibraryEvalExamples contains code samples demonstrating how to use the CNTK Library Eval API in C++ and C#.

On Windows,

  • You need Visual Studio 2015 update 3 for using these samples.
  • The samples should be built for the 64-bit target platform. Otherwise some issues arise when calling the library. Please also refer to the Troubleshoot CNTK page for more information.
  • After a successful build, the executable is saved under the $(SolutionDir)..\..$(Platform)$(ProjectName).$(Configuration)\ folder, e.g. ..\..\X64\CNTKLibraryCSEvalCPUOnlyExamples.Release\CNTKLibraryCSEvalCPUOnlyExamples.exe.

On Linux, only C++ is supported. Please refer to Makefile for building samples. The target name CNTKLIBRARY_CPP_EVAL_EXAMPLES is used to build CNTKLibraryCPPEvalExamples.

CNTK Library Eval Java Examples

  • This API is still experimental and subject to change.

  • If you are using the bindings in your java project, add the cntk.jar file to the classpath. If you are working with an IDE you should add this as an unmanaged jar. The cntk.jar file can be found in the distributed CNTK binaries. You can also build cntk.jar from code base by yourself. In this case, it can be found in the "java" folder of CNTK's output directory. Please refer to the Linux and Windows instructions for more details.

  • The JavaEvalTest contains an example Java project that evaluates a CNN using the Java API.

Examples for evaluating multiple requests in parallel

The CNTKLibraryEvalExamples includes sample code to evaluate multiple evaluation requests in parallel. The sample code also shows how to share model parameters among multiple instances of the same model to reduce memory usage.

EvalDll Eval C++/C# Examples

The EvalClients.sln contains the following projects demonstrating how to use the EvalDll library in C++ and C#.

On Windows, The solution file EvalClients.sln is used to build and run samples. Please note

  • You need Visual Studio 2015 update 3 for using these samples.
  • The samples should be built for the 64-bit target platform. Otherwise some issues arise when calling the library. Please also refer to the Troubleshoot CNTK page for more information.
  • After a successful build, the executable is saved under the $(SolutionDir)..\..$(Platform)$(ProjectName).$(Configuration)\ folder, e.g. ..\..\X64\CPPEvalClient.Release\CppEvalClient.exe.

On Linux, please refer to Makefile for building samples. The target name EVAL_CLIENT, and EVAL_EXTENDED_CLIENT are used to build these projects.

Python Eval Examples

You can also use Python to evaluate a pre-trained model as described here.

Clone this wiki locally