"Constant" Error when loading in model using loadLearnerForCoder()

1 vue (au cours des 30 derniers jours)
Joshua
Joshua le 28 Fév 2025
Commenté : Joshua le 3 Mar 2025
On a project at work, we are trying to convert a ML model to C++ using the MATLAB coder. We have done it sucessfully before but now something has gone wrong. In MATLAB Coder, when it runs the error check, it complains the function call for loadLearnerForCoder fails b/c "The Model must be a compiler-time constant". For the sake of a testing, I regenerated a smaller model (b/c our last one took a whole day to generate). When I load it in the same way, it gives no errors. When comparing the two models in MATLAB I can't really see an issue. Does anyone know how to debug this better or see what MATLAB is erroring out on? Also I cannot provide any code for this due to work. I've tried using coder.constant() and it doesn't work. I also used coder.screener() and it reported no problems.
  4 commentaires
Walter Roberson
Walter Roberson le 28 Fév 2025
Try it as one line.
Joshua
Joshua le 3 Mar 2025
Unfortunately that did not work.

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Generating Code dans Help Center et File Exchange

Produits


Version

R2024b

Community Treasure Hunt

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

Start Hunting!

Translated by