What is the error message 'Unrecognized field name "summary".' from loadPyTorc​hExportedP​rogram() ?

Hi, everyone !
I am trying converting PyTorch python codes into MATLAB codes and then code-generating them to C/C++.
So, I have tested the MATLAB function 'loadPyTorchExportedProgram(). However, when the function is called with my exported PyTorch code, it is always failed showing the error message, Unrecognized field name "summary".
I obeyed the requirements for the function as follows:
  • PyTorch version 2.8.0 used
  • MATLAB Coder Support Package for PyTorch and LiteRT Models installed
  • In PyTorch code, the model exported using torch.export.export() and torch.export.save()
There is a strange point. Although sample codes and process described in the MATLAB document 'Prepare PyTorch Models for MATLAB and Simulink Code Generation - MATLAB & Simulink' are used as-is, the result is always the same as follows.
What is the problem ?

 Accepted Answer

As confirmed after contacting MathWorks Technical Support, the issue was resolved by installing a supported C++ compiler and configuring it using mex -setup C++.

More Answers (0)

Products

Release

R2026a

Asked:

on 16 Sep 2026 at 1:55

Answered:

on 21 Sep 2026 at 6:43

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!