培训 ML.NET -- System.OutOfMemoryException
Training ML.NET -- System.OutOfMemoryException
首先,我是 ML.NET(以及整个 ML)的新手。我正在尝试使用 SQL 服务器 table 作为我的数据源来设置模型。我从同一个 table 中选择一个标签和 18 个特征,这个 table 中包含超过 300 万条记录。当我完成选择 label/features 并单击 Train 按钮时,我收到提示,告诉我 VS 将从 SQL 服务器下载 1.1 GB 的数据(托管在同一台机器上)我承认。我收到指示下载正在进行的反馈,持续 30 - 60 秒。然后我得到以下错误:
Error retrieving SQL data: "Exception of type 'System.OutOfMemoryException' was thrown."
at Microsoft.ML.ModelBuilder.ToolWindows.ModelBuilderDataContext.<DownloadSqlFileAsync>b__88_0()
at System.Threading.Tasks.Task`1.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.ML.ModelBuilder.ToolWindows.ModelBuilderDataContext.<DownloadSqlFileAsync>d__88.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.ML.ModelBuilder.ToolWindows.ModelBuilderDataContext.<<OnDataChanged>b__77_1>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.ML.ModelBuilder.ToolWindows.TrainTabDataContext.<BuildTrainModelParametersAsync>d__138.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.ML.ModelBuilder.ToolWindows.TrainTabDataContext.<StartTrainingAsync>d__130.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at Microsoft.ML.ModelBuilder.ToolWindows.TrainTabControl.<<StartTraining_Click>b__5_0>d.MoveNext()
一些有趣的事实:
我在尝试训练时观察了机器上的 RAM 数量,但它没有超过总可用 RAM 的 65%。
在同一个 VS 解决方案中,我有另一个应用程序,我经常通过 EF 将有问题的 table 全部读入内存。
我正在使用 VS Community 和 SQL Express
我看到在错误发生之前 RAM 数量可能增加了 3 GB 左右。它闻起来很糟糕,就像它是 运行 32 位进程(这可以理解所有这些)但是如果有一个设置,我找不到它。我已经检查了我的 ML 项目的 Build 属性,并确保将其设置为 64 位,但我不确定这是否是您训练模型时所使用的。
ModelBuilder(必然)是一个 32 位扩展,因此它无法处理我试图推送给它的那么多数据。我已经打开了一个错误/功能请求,以将数据引入到一些 64 位代码中,或者更改数据的摄取方式。
https://github.com/dotnet/machinelearning-modelbuilder/issues/647
首先,我是 ML.NET(以及整个 ML)的新手。我正在尝试使用 SQL 服务器 table 作为我的数据源来设置模型。我从同一个 table 中选择一个标签和 18 个特征,这个 table 中包含超过 300 万条记录。当我完成选择 label/features 并单击 Train 按钮时,我收到提示,告诉我 VS 将从 SQL 服务器下载 1.1 GB 的数据(托管在同一台机器上)我承认。我收到指示下载正在进行的反馈,持续 30 - 60 秒。然后我得到以下错误:
Error retrieving SQL data: "Exception of type 'System.OutOfMemoryException' was thrown."
at Microsoft.ML.ModelBuilder.ToolWindows.ModelBuilderDataContext.<DownloadSqlFileAsync>b__88_0()
at System.Threading.Tasks.Task`1.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.ML.ModelBuilder.ToolWindows.ModelBuilderDataContext.<DownloadSqlFileAsync>d__88.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.ML.ModelBuilder.ToolWindows.ModelBuilderDataContext.<<OnDataChanged>b__77_1>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.ML.ModelBuilder.ToolWindows.TrainTabDataContext.<BuildTrainModelParametersAsync>d__138.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.ML.ModelBuilder.ToolWindows.TrainTabDataContext.<StartTrainingAsync>d__130.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at Microsoft.ML.ModelBuilder.ToolWindows.TrainTabControl.<<StartTraining_Click>b__5_0>d.MoveNext()
一些有趣的事实:
我在尝试训练时观察了机器上的 RAM 数量,但它没有超过总可用 RAM 的 65%。
在同一个 VS 解决方案中,我有另一个应用程序,我经常通过 EF 将有问题的 table 全部读入内存。
我正在使用 VS Community 和 SQL Express
我看到在错误发生之前 RAM 数量可能增加了 3 GB 左右。它闻起来很糟糕,就像它是 运行 32 位进程(这可以理解所有这些)但是如果有一个设置,我找不到它。我已经检查了我的 ML 项目的 Build 属性,并确保将其设置为 64 位,但我不确定这是否是您训练模型时所使用的。
ModelBuilder(必然)是一个 32 位扩展,因此它无法处理我试图推送给它的那么多数据。我已经打开了一个错误/功能请求,以将数据引入到一些 64 位代码中,或者更改数据的摄取方式。
https://github.com/dotnet/machinelearning-modelbuilder/issues/647