Using CNTK from F#

1

I am trying to use CNTK from F#, I have added Cntk.Core.Managed-2.7 to my project (.NET framework 4.7.2 also tried under 4.5.0)

I only have the following code in Program.cs

let main argv =
    DeviceDescriptor.UseDefaultDevice().Type |> printfn "%A"

    0 //  

it compiles fine, but at run time I have the following exceptions:

System.TypeInitializationException: 'The type initializer for 'CNTK.CNTKLibPINVOKE' threw an exception.' TypeInitializationException: The type initializer for 'SWIGExceptionHelper' threw an exception.

and System.TypeInitializationException: 'The type initializer for 'CNTK.CNTKLibPINVOKE' threw an exception.' DllNotFoundException: Unable to load DLL 'Cntk.Core.CSBinding-2.7.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)

I have tried to locate Cntk.Core.CSBinding-2.7.dll but it does not allow me to add it to the project when I browse and manually add it.

I have added CNTK via Nuget.

How can I run CNTK from F# (scripting and in production code)? I have found the excellent blog of Mathias Brandewinder https://brandewinder.com/2017/12/23/baby-steps-with-cntk-and-fsharp/ but he adopts Code (whereas I use Visual Studio with .NET Framework) and so his script did not work at least for me.

Are there any other resources out there to access CNTK via F#?

neural-network
f#
pinvoke
cntk
f#-data

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0