- Run “mex -setup C++” to configure the C++ compiler.
- Run “mex -setup C“ to configure the C compiler.
Deploying trained agent to run in simulink hardware-in-the-loop (self-balancing robot)
8 次查看(过去 30 天)
显示 更早的评论
I currently have this error:
Toolchain 'Microsoft Visual C++ 2019 v16.0 | nmake (64-bit Windows)' does not contain a build tool named 'Assembler'
while following this answer: https://www.mathworks.com/matlabcentral/answers/757154-how-to-implement-reinforcement-learning-using-code-generation#answer_636561
I am using r2022a. I am trying to deploy my (DDPG) trained agent on arduino mega board using mathworks user-defined function block but I run into the above error.
I have also tried using the predict block and I get the error:
Caused by: MAT-file C:\RL_SBR\RL_SBR\RL_SBR\savedAgents\Agent1780.mat does not contain a valid SeriesNetwork, DAGNetwork, dlnetwork, yolov2ObjectDetector, yolov3ObjectDetector, yolov4ObjectDetector, ssdObjectDetector or pointPillarsObjectDetector object.
Although I am able to simulate the mat file:
load Agent1780.mat
simOpts=rlSimulationOptions('MaxSteps',1000);
xpr=sim(env,saved_agent,simOpts);
I will appreciate any feedback.
0 个评论
回答(1 个)
Abhishek Chakram
2024-2-16
编辑:Abhishek Chakram
2024-2-16
Hi Justus Nwoke,
It looks like you are encountering the error message "Toolchain 'Microsoft Visual C++ 2019 v16.0 | nmake (64-bit Windows)' does not contain a build tool named 'Assembler'" suggests that the toolchain configured for your MATLAB session does not have an assembler tool included. This might be an issue if you are trying to compile code that requires assembly language compilation.
To resolve this, you can check if the toolchain is set up correctly in MATLAB:
The second error message suggests that the MAT-file you are trying to use with the Predict block does not contain an object that the block recognizes. DDPG agents consist of actor and critic networks, and you might need to extract the underlying neural network from the actor for prediction purposes. Here is an example code for extracting and saving the actor network:
load('Agent1780.mat', 'saved_agent');
actorNetwork = getActor(saved_agent); % Extract the actor network
% Assuming the actor network is a SeriesNetwork or a compatible type
save('ActorNetwork.mat', 'actorNetwork');
Then, use the “ActorNetwork.mat” file with the Predict block.
You can refer to the following documentation to know more about the “getActor” function used: https://www.mathworks.com/help/reinforcement-learning/ref/rl.agent.rlqagent.getactor.html
Best Regards,
Abhishek Chakram
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!