Machinelearning: TrainerUtils.CreatePredicate fails on .NET 4.6.2 (.NET 0.10.0)

Created on 19 Feb 2019  路  7Comments  路  Source: dotnet/machinelearning

System information

  • OS version/distro: Windows 10
  • .NET Version (eg., dotnet --info): 4.6.2

Issue

TrainerUtils.CreatePredicate appears to use an extension method of IEnumerable that does not exist for .NET 4.6.2:

https://github.com/dotnet/machinelearning/blob/13b33392dd3fbffc0922b2af72c8236b74c95fc0/src/Microsoft.ML.Data/Training/TrainerUtils.cs#L235

This is probably the same issue that causes #2566.

bug

Most helpful comment

Looks like the same issue as #1072. However, we re-introduced this problem, only in a different spot.

Unfortunately there are a few methods in .NET Standard 2.0 which aren't available in .NET Framework 4.6.1, but 4.6.1 "claims" it supports .NET Standard 2.0.

Here is the list: https://github.com/dotnet/standard/blob/205332796a9a0f869ff698402c3496f14cc71f50/netstandard/src/ApiCompatBaseline.net461.txt

/cc @ericstj @terrajobst - maybe we should write a code analyzer for these methods? That way folks know not to call them in netstandard2.0 libraries.

All 7 comments

From readme:

ML.NET also works on the .NET Framework 4.6.1

So I guess this one should be treated as bug.
Thank you for reporting this!

Looks like the same issue as #1072. However, we re-introduced this problem, only in a different spot.

Unfortunately there are a few methods in .NET Standard 2.0 which aren't available in .NET Framework 4.6.1, but 4.6.1 "claims" it supports .NET Standard 2.0.

Here is the list: https://github.com/dotnet/standard/blob/205332796a9a0f869ff698402c3496f14cc71f50/netstandard/src/ApiCompatBaseline.net461.txt

/cc @ericstj @terrajobst - maybe we should write a code analyzer for these methods? That way folks know not to call them in netstandard2.0 libraries.

It seems like people are working on this a bit too quickly. .NET Framework 4.6.1 by itself does not support .NET standard 2.0, it just requires an additional nuget IIRC. The fix should be that .NET 4.6.1 installations should include that nuget.

Edit: I am wrong, apparently there are some things that are just broken with .NET Framework 4.6.1's support for .NET standard 2.0 that can't be fixed with compatibility DLLs.

@safern @danmosemsft - is there a way to get our netfx CI to run on a machine with .NET Framework 4.6.1? That would catch these issues (assuming the code path is covered in a test).

Additional note: our application has been working fine so far with ML.NET 0.8.0 + .NET Framework 4.6.1 (given that we also netstandard.dll)

@safern @danmosemsft - is there a way to get our netfx CI to run on a machine with .NET Framework 4.6.1? That would catch these issues (assuming the code path is covered in a test).

I think we would need a special build pool which has only net461 installed. I don't think we currently have a pool with that set of machines. cc: @chcosta how feasible is this?

Btw, if ML.NET moves to run tests in helix, this kind of requests might be simple as the goal for build machines is to use the hosted ones.

if ML.NET moves to run tests in helix

Unfortunately we don't have the time or resources to do something like that before v1.0.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

daholste picture daholste  路  3Comments

pgovind picture pgovind  路  3Comments

frankhaugen picture frankhaugen  路  3Comments

rogancarr picture rogancarr  路  3Comments

sfilipi picture sfilipi  路  4Comments