News

.NET Coders Clamor for C# Support in Microsoft's CNTK AI Toolkit

It's right there in the description of Visual Studio Code Tools for AI: "CNTK supports both Python and BrainScript programming languages."

But some .NET-centric coders are clamoring for support of traditional .NET languages like C#, Visual Basic and F#. This has been an issue for a while and was just raised again with a new post on the Issues section of the Microsoft Cognitive Toolkit (CNTK) GitHub repository, an open source toolkit for commercial-grade distributed deep learning.

CNTK is actually written in C++, which can access the toolkit directly, but apparently few developers actually do that, preferring Python. From its initial release, CNTK has allowed access from BrainScript, which is actually more of a configuration language. Upon the release of the TensorFlow open source software library for machine intelligence in 2015, many AI developers gravitated toward it, to the point it now dominates the field. The CNTK team last year added a Python API in v2 of the toolkit to accommodate those developers.

Some .NET developers, however, are apparently feeling a little left out.

A developer with the handle nikosdim1 revisited the issue recently with a post titled "C# and .NET support barking." While praising the Visual Studio IDE and performance when using CNTK as opposed to other IDEs, he highlighted the lack of C# support:

"Strangely, though, it seems that we have to abandon C#/VB/F# and learn python because CNTK is more supported in this language (OK C++ too but this is not a 'clean' .net language) maybe because other frameworks rely more on Python.

This means that: "Don't use .net languages for the next revolution of AI because the MS framework does not seems to support them fully. Go with the others" [author's emphasis].
The issue actually picks up on a thread in a separate issue posted in October 2016, titled ".NET Support." There, "StevenGann" referenced an even earlier post that referenced yet another post the month before and decried the lack of progress on the issue:
I'm eager to finally work with deep learning on Windows with C# instead of on Linux with Python. I'm sure Python bindings were helpful to some devs, but frankly every other deep learning framework already supports Python and C++. I'm surprised .NET hasn't been a higher priority, since it's something no other system has been able to provide. Now's the chance to become the de facto deep learning library for OOP development!

That post was answered on Oct. 27, 2016, by Wolfgang, apparently from Microsoft, who said: "Yes Steven, we hear you and we are sorry for the delay. This is now one of the highest priority items for us, no definite 'landing day yet', but we should be able to give you at least a date shortly ...."

Some work on the issue has been done, as documentation for CNTK, for example, says: "Evaluate models with Python, C++, C# and BrainScript" and there's even a post from August 2017 titled "Using CNTK with C#/.NET API." That post says: "CNTK v2.2.0 provides C# API to build, train, and evaluate CNTK models."

But that's apparently not quick or complete enough for nikosdim1 and some others. Nikosdim1 said he or she is still expecting a high-level C# API as promised, along with more C# examples in the documentation.

A developer with the handle sharpwood also weighed in: "Now, many .Net programmers learn python for deep learning, and if they adapt to python, will they not give up TensorFlow and PyTorch back to .NET and CNTK ? In the age of AI, CNTK is not just the CNTK team, but also the future of Microsoft's .Net and Visual Studio product lines."

nikoskim1 agreed: "I have used Tensorflow on Python and the lack of a good IDE and the slow startups was overwhelming, in comparison with VS and C#/VB. Maybe when MS finally support .NET programmers on CNTK we will be already, fanatic Tensorflowers !!!"

Another user referenced the older post about the same issue, and sharpwood finally concluded the thread two days ago with a positive statement about using Python, preferred by many for AI programming: "It feels good to write python with VS2017, and it's suitable for c#/vb.net programmers."

For the record, I reached out to a Microsoft source who confirmed evaluation and training are currently supported for C# in CNTK, albeit with a few missing features such as distributed learning, which reportedly will be added if there's a need. The source doesn't see too much of effort on this.

The CNTK team was designing a high-level C# API -- important for broad adoption by the .NET world -- and that's expected to resume soon after work is completed on the Open Neural Network Exchange (ONNX) project, which is described as "the first step toward an open ecosystem that empowers AI developers to choose the right tools as their project evolves." That was introduced last September by Microsoft and Facebook.

About the Author

David Ramel is the editor of Visual Studio Magazine.

comments powered by Disqus
Upcoming Events

.NET Insight

Sign up for our newsletter.

I agree to this site's Privacy Policy.