Filter löschen
Filter löschen

Can I save a model using saveLearnerForCoder that is larger than 2GB

8 Ansichten (letzte 30 Tage)
Savannah D
Savannah D am 22 Jan. 2024
Beantwortet: arushi am 4 Jul. 2024 um 5:39
I am currently training several regression models that are quite large. To save time on retraining if something were to happen, I've been trying to use saveLearnerForCoder; however, I keep getting the error "Warning: Variable 'compactStruct' was not saved. For variables larger than 2GB use MAT-file version 7.3 or later." but when I try to use the '-v7.3' tag, it says it's too many input variables.
Is there a way to work around the file size/use a different function to save the full model when it is large? Regular save() also does not seem to work because it loads in an empty struct. Thanks!

Antworten (1)

arushi
arushi am 4 Jul. 2024 um 5:39
Hi Savannah,
I understand from your query that you want to save variables larger than 2GB. For this, you can use the '-v7.3' flag with the 'save' function. Here is an example of how to use it:
save('model.mat', 'var', '-v7.3');
In '-v7.3', the variables are saved with compression by default. If you do not want this behavior, you can use the '-nocompression' flag.
You can refer to the documentation on version flag for more information:
Hope this helps!

Produkte


Version

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by