How to import a pre trained linear regression model from python to matlab?
48 次查看(过去 30 天)
显示 更早的评论
If I trained a model using python. Is there any way to import or use that model in matlab? Finally I want to genarate a c code after adding something to that in matlab.
回答(1 个)
David Fink
2020-5-5
To import from Python to MATLAB, save the model in a format MATLAB can import:
or a simpler format, like text or csv.
To generate C code from the imported model, use MATLAB Coder or GPU Coder:
5 个评论
David Willingham
2021-5-5
Hi Shayne,
Here is an example that shows how to call GoogLeNet into Simulink using the MATLAB function block:
Also, there are the following blocks that support calling popular model types directly:
shayne sudhakar
2021-5-14
编辑:shayne sudhakar
2021-5-14
Hi David,
Thanks for your advise.
I tried this, but I was able to directly get a .h5 file of model weights from keras.
So importkeraslayers(model file) worked well.
But unfortunately the gensim(net) function does not operate on the 'net' file generated from the importkeraslayers function. It shows an error of incorrect argument datatype or missing argument in call to function 'gensim'
Can you provide me with some insight on this. Thanks a ton.
Shayne
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Call Python from MATLAB 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!