machinelearning icon indicating copy to clipboard operation
machinelearning copied to clipboard

large models loading with mlcontext.model.load ends up OutOfMemoryException

Open boneatjp opened this issue 1 year ago • 5 comments

System Information (please complete the following information):

  • OS & Version: Windows 11 Pro 23H2 64GB RAM
  • ML.NET Version: Microsoft.ML Ver3.0.0, Microosft.ML.AutoML Ver0.21.0
  • .NET Version: .NET 8

Describe the bug When loading models which size are over 100MB, mlcontext.model.load throws Exception.

Viewing stack tace, 'System.Reflection.TargetInvocationException' (Microsoft.ML.Core.dll)

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.

Additional context When loading models which size are less than 100MB, no problem.

boneatjp avatar Jan 09 '24 12:01 boneatjp

Is it a tensorflow/torchsharp model or a normal ML.NET model?

Are you able to upload the model for us to have a repro?

michaelgsharp avatar Jan 10 '24 17:01 michaelgsharp

This issue has been marked needs-author-action and may be missing some important information.

ghost avatar Jan 10 '24 17:01 ghost

I just use Microsoft.ML.AutoML, mostly models are LightGBM, I guess.

Uploading models isn't any trouble for me. I'm not sure if I could upload it here with that kind of size.

boneatjp avatar Jan 11 '24 09:01 boneatjp

I found out that I could use GitLFS to upload large files. Where is the good place to upload it?

boneatjp avatar Jan 14 '24 08:01 boneatjp

model.zip.001.zip model.zip.002.zip model.zip.003.zip model.zip.004.zip model.zip.005.zip model.zip.006.zip model.zip.007.zip model.zip.008.zip

Using 7-zip, model.zip is splitted to model.zip.001 to model.zip.008. Here files must have extension like .zip so renamed like model.zip.001 to model.zip.001.zip. They should be renamed refore combining.

boneatjp avatar Jan 21 '24 02:01 boneatjp