Error when running a Simulink simulation with a tensorflow ANN using the "Predict" block
8 次查看(过去 30 天)
显示 更早的评论
Hello everyone,
I have trained a simple neural network (2 hidden layers) in tensorflow and imported it into Matlab using the "importNetworkFromTensorflow" command. Now I want to use it in a Simulink simulation. To do this, I added the predict block, saved the model in a *.mat file and specified it there. The import seems to work (the layers are displayed accordingly in the mask). Unfortunately, I get the following error during the simulation and have not yet been able to find a description of the error or a solution to the problem.
Error in '.../Subsystem/Predict1': Failed to evaluate mask initialization commands.
Caused by:
Error using Simulink.Simulation.internal.DesktopSimHelper
Network input data format string cannot be empty
What do I have to do to make the simulation work?
I am using Tensorflow 2.10.1 and Matlab 2023b.
Thank you very much
2 个评论
Angelo Yeo
2024-1-24
In order to find the precise cause and solution for the issue you are currently experiencing, I believe that the following additional information would be necessary. If you could provide the following information, it would enable contributors, including myself, to assist you more effectively:
1) Example files and data files that can reproduce the issue
2) Exact steps to reproduce the same problem using the files you provided
3) All error messages that appear when the issue occurs
Sivylla Paraskevopoulou
2024-1-24
Hi Patrick, the error indicates there is an issue with the input. Without having more information, as Angelo suggested above, it's hard to know what exactly the issue is. Just a guess though... The importNetworkFromTensorFlow imports the model as a dlnetwork object. If you followed the example Classify Images in Simulink with Imported TensorFlow Network, the network is imported as a DAGNetwork object using the importTensorFlowNetwork function.You used the recommended import function, but there are probably some differences in formatting the input data.
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Deep Learning Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!