microsoft / CNTK

Microsoft Cognitive Toolkit (CNTK), an open source deep-learning toolkit
https://docs.microsoft.com/cognitive-toolkit/
Other
17.5k stars 4.29k forks source link

Support for netcoreapp2.0 #2352

Open robinhad opened 7 years ago

robinhad commented 7 years ago

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

Tixxx commented 6 years ago

Sounds good @olmobrutall . As for the virtual dlls, it's because in our .targets files we have "PreserveNewest" for each included item, the packageReference style didn't show these in solution explorer but i think with the new SDK-style projects, all externals are shown now. We can try putting False for each item when packing the nugets. Are these dlls causing too much noise for you?

KichangKim commented 6 years ago

@Tixxx Thanks for .net core supporting!

For the virtual dlls, some projects (like https://github.com/shimat/opencvsharp ) makes their native dlls into subfolder called "dll/x86/" or "dll/x64" so the project view is very clean.

KichangKim commented 6 years ago

@Tixxx Also, I found that newest build throw System.StackOverflowException on Trainer.TrainMinibatch().

My code did work with CNTK.GPU v2.5.1 (.NET Framework 4.7.1) and exactly same code throws above exception with CNTK.GPU v2.6.0-rc0.dev20180821 (.NET Core 2.1).

Both test uses saved model and checkpoint data from 2.5.1.

Tixxx commented 6 years ago

@kkc0923 Thanks for the link. For the other exception you are seeing, do you mind opening another issue? It would be great if you can paste you code there as well. We have daily end-to-end tests to test that code path and they have been passing all along. If this is a regression, we will need to fix it asap. Thanks.

KichangKim commented 6 years ago

@Tixxx I created seperated issue ticket with minimum reproducible code. #3368 I hope this will help you.

pksorensen commented 6 years ago

Another issue that i ran into, https://stackoverflow.com/questions/51974745/how-to-load-a-onnx-model-with-cntk-on-dotnet-core

If i do a normal console app in visual studio and use latest stable version from nuget it loads and works fine. Have not figured out why it dont work with dotnet core/new csproj format.

olmobrutall commented 6 years ago

@Tixxx web app works perfectly too! Thanks!

pksorensen commented 6 years ago

I created a repro here with a none working 2.6 example: https://github.com/pksorensen/cntk-issue-26

Tixxx commented 6 years ago

@pksorensen I tested your app, it looks like the exception is agnostic to .net platform but related to cntk version because i see it fails on both net framework and netcore with 2.6.0-rc0.dev20180821 but passes for 2.5.1 on net framework. I'm suspecting this might be related to how the model was generated. That particular "attribute is missing type" exception only happens if the onnx IR version is >= 2 which is the case in 2.6.0, I need to get confirmation of what the IR version is in 2.5.1. Meanwhile if you can refer to this similar issue(https://github.com/onnx/models/issues/9) in ONNX to see if adding type INT on the "axis" attribute in your model helps that would be great. If not, please open another issue for us to track as this thread for net core support topic. Thanks.

pksorensen commented 6 years ago

Thanks @Tixxx - as i downloaded the model from the model zoo thing, i cannot update it myself. But i will try to see if i can regenerate the onnx file and take it from there.

pksorensen commented 6 years ago

problem was solved with newer model . thanks @Tixxx