CNTK icon indicating copy to clipboard operation
CNTK copied to clipboard

Support for netcoreapp2.0

Open robinhad opened this issue 9 years ago • 61 comments

Is there any plans to bring CNTK to, let's say, .NET Standard 2.0?

robinhad avatar Sep 14 '17 23:09 robinhad

Yes, CNTK C# API will comply with .NET 2.0.

cha-zhang avatar Sep 15 '17 14:09 cha-zhang

Can I ask for ETA?

robinhad avatar Sep 15 '17 15:09 robinhad

I'm getting warning message when import CNTK.GPU from nuget:

Warning NU1701 Package 'CNTK.GPU 2.2.0' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETCoreApp,Version=v2.0'. This package may not be fully compatible with your project. CNTKTest D:\Projects\CNTKTest\CNTKTest\CNTKTest.csproj 1

Isn't .Net Core 2.0 support ship with CNTK 2.2 yet?

KichangKim avatar Sep 17 '17 09:09 KichangKim

@kkc0923 @robinhad For .NET Core 2.0 support (e.g. Raspberry PI) . One of the main limitations faced by CNTK team is to bring the C++ DLL to ARM OS, in addition to Linux etc.

It will come. Community support is welcome.

JimSEOW avatar Sep 17 '17 11:09 JimSEOW

Just got CNTK 2.2 released. One of many features added to this release is the Basic C# training API. While we believe CNTK C# API (for training and evaluation) is compatible with .Net core 2.0, we did not package CNTK C# API as a .Net core NuGet. Due to limited resources, we hope someone from the community can pick up this task to make a .net core 2.0 NuGet package.

Regarding, ARM support, I agree with @JimSEOW.

liqunfu avatar Sep 18 '17 02:09 liqunfu

@liqunfu I'm sorry for dummy question, but do you have instructions or materials about this? I could try to do it this week

robinhad avatar Sep 18 '17 02:09 robinhad

@robinhad, No problem. @kkc0923 had tried to work with .NetCoew 2.0. How did it go? I guess it requires VS 2017 for .NetCore. I will install VS 2017 and try it out.

liqunfu avatar Sep 20 '17 23:09 liqunfu

@liqunfu Yes, I tried it by using latest VS 2017 + .NetCore 2.0 SDK. Then created ".Net Core Console Application" and imported CNTK.GPU 2.2 from Nuget.

KichangKim avatar Sep 21 '17 01:09 KichangKim

@kkc0923 Is there any hope we can use it in Xamarin by targeting .NET Standard?

robinhad avatar Sep 21 '17 01:09 robinhad

@robinhad If CNTK does fully support .NET Standard 2.0 and Nuget Packaging, it will work with Xamarin, but not yet I think

KichangKim avatar Sep 21 '17 02:09 KichangKim

No success with using CNTK on .netcore 2.0, get following warning for both GTPU and CPUOnly

Warning NU1701 Package 'CNTK.GPU 2.2.0' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETCoreApp,Version=v2.0'. This package may not be fully compatible with your project.

I use VS2017. Any hints?

grzsz avatar Sep 25 '17 05:09 grzsz

AFAIK, Cntk's usage of .Net BCL is very limited, so netstandard 1.0 might be a better choice (the lowest version).

Ark-kun avatar Sep 27 '17 08:09 Ark-kun

@Ark-kun @robinhad For CNKT support of XAMRIN, it is a VERY Broad topics. Xamarin's To boldly go where no man has gone before ( cross platform to many OSs). One has to be very specific (which OS) when asking how and when CNTK will and can support XAMAIN.

JimSEOW avatar Sep 27 '17 09:09 JimSEOW

@JimSEOW @Ark-kun We have this table https://docs.microsoft.com/en-us/dotnet/standard/net-standard It is about to target lowest .NET Standard version possible to achive maximum portability @liqunfu I could try to run .NET Portability Analyzer to check what .NET Standard version CNTK can already support

robinhad avatar Sep 27 '17 10:09 robinhad

@liqunfu @JimSEOW @Ark-kun I run Portability Analyzer and got this report (attached). Instruction how to read this is there: https://github.com/Microsoft/dotnet-apiport/blob/master/docs/HowTo/PlatformPortability.md Long story short: current code is fully compatible with .NET Standard 2.0, lowest versions require changes, that you can find on Details page in attached report. CNTKApiPortAnalysis.xlsx I`m going to change target frameworks and will tell you tomorrow if it worked.

robinhad avatar Sep 27 '17 22:09 robinhad

@robinhad Errors concerning the exception classes look like noise. InteropServices.* are more problematic. I guess, HandleRef limits us to 2.0.

Ark-kun avatar Sep 28 '17 00:09 Ark-kun

@liqunfu @JimSEOW @Ark-kun I built successfully for .NET Standard and run "Training" unit tests successfully. I will try to run EvalTests this weekend and then will make a PR.

robinhad avatar Sep 28 '17 21:09 robinhad

@liqunfu Can you share pretrained models so I can test Eval examples? I don't have GPU to train on.

robinhad avatar Oct 03 '17 16:10 robinhad

https://github.com/Microsoft/CNTK/tree/master/PretrainedModels

cha-zhang avatar Oct 03 '17 17:10 cha-zhang

@cha-zhang Could you share atis.dnn model?

robinhad avatar Oct 03 '17 19:10 robinhad