Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

System.ArgumentException occurring only in single-file published application #5852

Open
francescomazzurco opened this issue Jun 18, 2021 · 3 comments
Labels
loadsave Bugs related loading and saving data or models need info This issue needs more info before triage

Comments

@francescomazzurco
Copy link

Hi,

The following line of code:

var versionInfo = FileVersionInfo.GetVersionInfo(typeof(RepositoryWriter).Assembly.Location);

Seems to create some problems when the application is published as a single file. I honestly don't have a full understanding on how some paths and locations behave in this scenario.

For completeness, here is the exception with its stack trace:

Training failed with the exception: System.ArgumentException: The path is empty. (Parameter 'path')`
at System.IO.Path.GetFullPath(String path)
   at System.Diagnostics.FileVersionInfo.GetVersionInfo(String fileName)
   at Microsoft.ML.RepositoryWriter.CreateNew(Stream stream, IExceptionContext ectx, Boolean useFileSystem)
   at Microsoft.ML.ModelOperationsCatalog.Save(ITransformer model, DataViewSchema inputSchema, Stream stream)
   at Microsoft.ML.AutoML.ModelContainer..ctor(MLContext mlContext, FileInfo fileInfo, ITransformer model, DataViewSchema modelInputSchema)
   at Microsoft.ML.AutoML.RunnerUtil.TrainAndScorePipeline[TMetrics](MLContext context, SuggestedPipeline pipeline, IDataView trainData, IDataView validData, String groupId, String labelColumn, IMetricsAgent`1 metricsAgent, ITransformer preprocessorTransform, FileInfo modelFileInfo, DataViewSchema modelInputSchema, IChannel logger)
   at Microsoft.ML.AutoML.Experiment`2.Execute()
   at Microsoft.ML.AutoML.ExperimentBase`2.Execute(ColumnInformation columnInfo, DatasetColumnInfo[] columns, IEstimator`1 preFeaturizer, IProgress`1 progressHandler, IRunner`1 runner)
   at Microsoft.ML.AutoML.ExperimentBase`2.ExecuteCrossValSummary(IDataView[] trainDatasets, ColumnInformation columnInfo, IDataView[] validationDatasets, IEstimator`1 preFeaturizer, IProgress`1 progressHandler)
   at Microsoft.ML.AutoML.ExperimentBase`2.Execute(IDataView trainData, ColumnInformation columnInformation, IEstimator`1 preFeaturizer, IProgress`1 progressHandler)
   at Microsoft.ML.AutoML.ExperimentBase`2.Execute(IDataView trainData, String labelColumnName, String samplingKeyColumn, IEstimator`1 preFeaturizer, IProgress`1 progressHandler)

Thanks

@michaelgsharp
Copy link
Member

How are you publishing everything as a single file? Are you using something to embed all the resources into a single .dll?

@michaelgsharp michaelgsharp added loadsave Bugs related loading and saving data or models need info This issue needs more info before triage labels Jul 22, 2021
@francescomazzurco
Copy link
Author

francescomazzurco commented Jul 23, 2021

Yes, I am using the option <IncludeNativeLibrariesForSelfExtract>True</IncludeNativeLibrariesForSelfExtract> in my PublishProfile in order to get a single file.

@pplusawork
Copy link

It looks like this is related to #4505 and PR #4512 which looks like it was blocked pending review due to code coverage?

In my case, I was using a self-contained Linux-x64 publish profile, and checking the "Produce single file" box, i.e. <PublishSingleFile>True</PublishSingleFile>. Setting that to false seems to be a reliable work around, though not ideal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
loadsave Bugs related loading and saving data or models need info This issue needs more info before triage
Projects
None yet
Development

No branches or pull requests

3 participants