dotnet / dotnet/machinelearning
Segmentation Fault
- Dominant language
- C#
- Stars
- 9.4k
- Forks
- 2k
- Avg merge
- 2d 20h
- Merged PRs (30d)
- 11
Description
**System Information (please complete the following information):**
- OS & Version: Linux 20.04.5 LTS (Focal Fossa)
- Microsoft.ML Version: 3.0.0-preview.23266.6
- Microsoft.ML.TimeSeries Version: 3.0.0-preview.23266.6
- .NET Version: .NET 6.0
**Describe the bug**
The C# application crashes giving a **segmentation fault (core dumped)** error.
The kernel logs show this thing, "**motadata992 kernel: [2321935.184101] aiopsengine[1265920]: segfault at 10 ip 00007f00fb38143d sp 00007f014f4fc0a8 error 4 in libMklImports.so[7f00fa469000+5888000]**".
**To Reproduce**
No reproduce steps.
**Expected behavior**
The C# application should run without crashing.
**Screenshots, Code, Sample Projects**
**Additional context**
Below is the Anomaly Detector Code which uses SR-CNN approach provided by ML-Net to detect anomalies.
`using System.Text;
using Microsoft.ML;
using Microsoft.ML.TimeSeries;
namespace ML.Tasks;
public class AnomalyDetector
{
private readonly MLContext _mlContext;
public AnomalyDetector(MLContext mlContext)
{
_mlContext = mlContext;
}
public List? Predict(IDataView dataView, StringBuilder errors)
{
try
{
var period = Util.CalculatePeriodicity(_mlContext, dataView, nameof(Input.Value));
var configOptions = new SrCnnEntireAnomalyDetectorOptions
{
DetectMode = SrCnnDetectMode.AnomalyAndMargin,
};
if (period != Constants.NotAvailable)
{
configOptions.Period = period;
}
return _mlContext.Data.CreateEnumerable(
_mlContext.AnomalyDetection.DetectEntireAnomalyBySrCnn(dataView, nameof(Prediction.Output),
nameof(Input.Value),
options: configOptions), false).ToList();
}
catch (Exception e)
{
Bootstrap.Logger.Error(e);
errors.Append($"error {e.Message} occurred while detecting anomalies, stack: {e.StackTrace}");
}
return null;
}
public class Prediction
{
public double[] Output { get; set; } = null!;
}
public class Input
{
public double Value { get; set; }
}
}`
Contributor guide
Assessment
This issue has not been assessed yet.