-
Notifications
You must be signed in to change notification settings - Fork 63
Using Local ML.NET Binaries With NimbusML
-
Increase the versions in
your_mlnet_root\build\BranchInfo.props
. The versions of the ml.net libraries only need to be increased high enough so that nuget will not be able to find the specific version any where but on your local machine. In the example below, the version was increased from1.2.0
->1.3.0
and0.14.0
->0.15.0
. See nuget.org for the latest published versions of the ml.net libraries.<PropertyGroup Condition="'$(IsStableProject)' == 'true'"> <MajorVersion>1</MajorVersion> <MinorVersion>3</MinorVersion> <PatchVersion>0</PatchVersion> <PreReleaseLabel>preview</PreReleaseLabel> </PropertyGroup> <PropertyGroup Condition="'$(IsStableProject)' != 'true'"> <MajorVersion>0</MajorVersion> <MinorVersion>15</MinorVersion> <PatchVersion>0</PatchVersion> <PreReleaseLabel>preview</PreReleaseLabel> </PropertyGroup>
-
Build ml.net.
-
Clean out the repository. This step is optional.
git clean -fxd
If there are issues when running the above command, this might be because there are programs which are actively using some of the files that are trying to be deleted. Try closing Visual Studio and stopping with End task in Task Manager any of its worker services which may be running in the background.
-
Build the libraries.
build -release
-
Create the nuget packages out of the libraries built in step (2). Some users have reported requiring
-release
as an additional argument to to thebuild
command to produce release nuget packages.build -buildPackages
-
-
Add the local nuget package directory created in step (2.iii) to
your_nimbusml_root\nuget.config
.<packageSources> <add key="nuget.org" value="https://api.nuget.org/v3/index.json" /> <!-- COMMENT THIS OUT <add key="MlNet_Daily" value="https://dotnet.myget.org/F/dotnet-core/api/v3/index.json" /> --> <add key="local_mlnet" value="your_mlnet_root\bin\packages" /> <!-- ADD THIS LINE --> </packageSources>
-
Update the versions in the DotNetBridge project file
your_nimbusml_root\src\DotNetBridge\DotNetBridge.csproj
to match the versions of the packages created in step (2). Note: the version values require the-preview
suffix to be recognized by nuget.<PackageReference Include="Microsoft.ML" Version="1.3.0-preview" /> <PackageReference Include="Microsoft.ML.CpuMath" Version="1.3.0-preview" /> <PackageReference Include="Microsoft.ML.EntryPoints" Version="0.15.0-preview" /> <PackageReference Include="Microsoft.ML.Mkl.Components" Version="1.3.0-preview" /> <PackageReference Include="Microsoft.ML.Mkl.Redist" Version="1.3.0-preview" /> <PackageReference Include="Microsoft.ML.ImageAnalytics" Version="1.3.0-preview" /> <PackageReference Include="Microsoft.ML.LightGBM" Version="1.3.0-preview" /> <PackageReference Include="Microsoft.ML.OnnxTransformer" Version="1.3.0-preview" /> <PackageReference Include="Microsoft.ML.TensorFlow" Version="1.3.0-preview" /> <PackageReference Include="Microsoft.ML.Ensemble" Version="0.15.0-preview" /> <PackageReference Include="Microsoft.ML.TimeSeries" Version="1.3.0-preview" />
-
Update the versions in
your_nimbusml_root\src\Platforms\build.csproj
to match the versions of the packages created in step (2). Note: the version values require the-preview
suffix to be recognized by nuget.<PackageReference Include="Microsoft.ML" Version="1.3.0-preview" /> <PackageReference Include="Microsoft.ML.CpuMath" Version="1.3.0-preview" /> <PackageReference Include="Microsoft.ML.EntryPoints" Version="0.15.0-preview" /> <PackageReference Include="Microsoft.ML.Mkl.Components" Version="1.3.0-preview" /> <PackageReference Include="Microsoft.ML.ImageAnalytics" Version="1.3.0-preview" /> <PackageReference Include="Microsoft.ML.LightGBM" Version="1.3.0-preview" /> <PackageReference Include="Microsoft.ML.OnnxTransformer" Version="1.3.0-preview" /> <PackageReference Include="Microsoft.ML.TensorFlow" Version="1.3.0-preview" /> <PackageReference Include="Microsoft.ML.Ensemble" Version="0.15.0-preview" /> <PackageReference Include="Microsoft.ML.TimeSeries" Version="1.3.0-preview" />
-
Build NimbusML and run the tests.
-
Clean out the repository. This step is optional but recommended to make sure all the previous binaries have been discarded.
git clean -fxd
If there are issues when running the above command, this might be because there are programs which are actively using some of the files that are trying to be deleted. Try closing Visual Studio and stopping with End task in Task Manager any of its worker services (ie.
Visual Studio - Python background analyzer
) which may be running in the background. -
Build NimbusML.
build --runTests
-
-
To remove the nuget cache, remove the
.nuget
folder in the home directory. -
To verify that NimbusML is using the ml.net binaries that were built locally, right click on any one of Microsoft.ML.*.dll in
your_nimbusml_root\dependencies\Python3.7\Lib\site-packages\nimbusml\internal\libs
and selectproperties->details
. The details page should show the updated version of the library (corresponding to step (1)) and it should also show that the library was built locally.