dotnet / machinelearning

ML.NET is an open source and cross-platform machine learning framework for .NET.
https://dot.net/ml
MIT License
8.92k stars 1.86k forks source link

The type initializer for 'Microsoft.ML.Transforms.TimeSeries.FftUtils' threw an exception. #6999

Closed mjanulaitis closed 3 months ago

mjanulaitis commented 4 months ago

System Information:

Describe the bug I am unable to use this library when my project is built with .Net 4.7.2. The same code is working for .net7.0-windows v7.0.15

To Reproduce Steps to reproduce the behavior:

  1. Create a project then call MLContext.AnomalyDetection.DetectSeasonality
  2. See error: The type initializer for 'Microsoft.ML.Transforms.TimeSeries.FftUtils' threw an exception. Inner exception: BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)

Expected behavior The function should not throw an exception.

Sample Snipet

            var mlContext = new MLContext();

            var dataView = mlContext.Data.LoadFromTextFile<DataModel>(path: i, hasHeader: true, separatorChar: ',');

            string inputColumnName = nameof(DataModel.value);

            int period = mlContext.AnomalyDetection.DetectSeasonality(dataView, inputColumnName);
michaelgsharp commented 4 months ago

Can you upload a full sample/repro project please?

dotnet-policy-service[bot] commented 3 months ago

This issue will now be closed since it had been marked no-recent-activity but received no further activity in the past 14 days. It is still possible to reopen or comment on the issue, but please note that the issue will be locked if it remains inactive for another 30 days.