-
Notifications
You must be signed in to change notification settings - Fork 61
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.0and0.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 -fxdIf 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
-releaseas an additional argument to to thebuildcommand 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.csprojto match the versions of the packages created in step (2). Note: the version values require the-previewsuffix 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.csprojto match the versions of the packages created in step (2). Note: the version values require the-previewsuffix 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 optionally 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 -fxdIf 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.
buildor, (to build and install the NimbusML wheel file in the dependencies python folder)
build --installPythonPackagesor, (to build, install the NimbusML wheel file and run all the tests)
build --runTests
-
-
To remove the nuget cache, remove the
.nugetfolder in the home directory. This is required every time that the local ML.Net packages are updated (while keeping the version numbers fixed) so that the NimbusML build will not use the older cached versions of the ML.Net packages. -
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\libsand 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.