Can I save a model using saveLearnerForCoder that is larger than 2GB
7 次查看(过去 30 天)
显示 更早的评论
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!
0 个评论
回答(1 个)
arushi
2024-7-4
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!
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!