0

This is a follow-up question from "c# Wrapper for CNTK step" After adding reference EvalWrapper.dll, The type or namespace name 'IEvaluateModelManagedF' could not be found error went away.

The next compile error I encounter is at line

model.CreateNetwork(string.Format("deviceId=-1\nmodelPath=\"{0}\"", modelFilePath));

Error CS1061 'IEvaluateModelManagedF' does not contain a definition for 'CreateNetwork' and no extension method 'CreateNetwork' accepting a first argument of type 'IEvaluateModelManagedF' could be found (are you missing a using directive or an assembly reference?)

I made sure all the DLLs are in the same directory as EvalWrapper.dll. What am I missing ? Thanks in advance,

William
  • 8,007
  • 5
  • 39
  • 43
Terry1998
  • 53
  • 1
  • 4
  • Can you post more of your code? Everything up to the offending line? – Anton Schwaighofer May 03 '16 at 16:27
  • Thanks for helping. The source code is the original code from source code CNTK program.cs . The comment doesn't allow me to put the complete code here. private static void EvaluateModelSingleLayer() { .... ..... // Load model string modelFilePath = Path.Combine(Environment.CurrentDirectory, @"..\Output\Models\01_OneHidden"); model.CreateNetwork(string.Format("deviceId=-1\nmodelPath=\"{0}\"", modelFilePath)); – Terry1998 May 03 '16 at 17:43
  • Can't repro with the information you post here. I just created an empty C# project, referenced `EvalWrapper.dll` (from a directory where all other required DLLs are present), adding a `using`, and then the code bits from `EvaluateModelSingleLayer` compiled just fine. Terry, you can edit your original question and add relevant code snippets. What type of project did you create? I could only imagine that your project is targeting a wrong architecture or something funny like that, that would prevent it from successfully loading the `EvalWrapper` – Anton Schwaighofer May 04 '16 at 10:09
  • Thanks again. What is the "using" need to add? I will try it on another machine if this still not working. – Terry1998 May 04 '16 at 16:39

1 Answers1

1

I encountered this error too. To solve the problem you should add the following using clause at the beginning of your code:

using Microsoft.MSR.CNTK.Extensibility.Managed;
quicktrick
  • 112
  • 1
  • 6