Skip to content

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

Open

Description

@boneatjp

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.

Activity

  1. ghost added
    untriagedNew issue has not been triaged
    on Jan 9, 2024
  2. michaelgsharp commented on Jan 10, 2024

    @michaelgsharp
    Contributor

    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?

  3. boneatjp commented on Jan 11, 2024

    @boneatjp
    Author

    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.

  4. ghost removed
    needs-author-actionMore information or action is needed from the author
    on Jan 11, 2024
  5. boneatjp commented on Jan 14, 2024

    @boneatjp
    Author

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

  6. boneatjp commented on Jan 21, 2024

    @boneatjp
    Author

    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.

  7. added
    bugSomething isn't working
    and removed
    untriagedNew issue has not been triaged
    on Jan 24, 2024
  8. added this to the ML.NET 4.0 milestone on Jan 24, 2024
  9. modified the milestones: ML.NET 4.0, ML.NET 5.0 on Jan 16, 2025
  10. added
    area-CoreCore ML.NET APIs and shared functionality
    on Sep 8, 2026
  11. rosebyte commented on Oct 22, 2026

    @rosebyte
    Member

    Triage: we will need to investigate the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-CoreCore ML.NET APIs and shared functionalitybugSomething isn't workinggreendevelopment

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions