Is the error stated below a result of using a different version of MATLAB than the one the code in question was created with?
9 views (last 30 days)
Show older comments
To preface this question, I tried to follow the steps in the video below and use an RL algorithm to simulate a walking robot using MATLAB R2020a
After downloading the resources in the video from his link in the description ( https://www.mathworks.com/matlabcentral/fileexchange/64227-matlab-and-simulink-robotics-arena-walking-robot?s_eid=PSM_15028 ), I tried to run the "createDDPGNetworks" file as he does as 7:07 in his video, and I got the error:
Unrecognized function or variable 'numObs'.
Error in createDDPGNetworks (line 12)
imageInputLayer([numObs 1 1],'Normalization','none','Name', 'observation')
While others have used his model and had plenty of success, I and a few others have gotten this same error. I was wondering if this is a result of him using MATLAB R2019a and me using MATLAB R2020a.
1 Comment
Lanh Van Nguyen
on 28 Jul 2020
Hi Sammy. I have the same error as yours. Have you fixed the problem yet?
Answers (2)
Yahya Madhi
on 27 Sep 2020
Hello Sammy
Not sure if you have resolved the issue, but if you have not, follow the following instructions:
- Run the script startupWalkingRobot.m
- Open the simulink model named walkingRobotRL2D.slx
- Run the script robotParametersRL.m
- In the script createDDPGNetworks.m edit line 53 to critic = rlQValueRepresentation(criticNetwork,observationInfo,actionInfo,'Observation',{'observation'},'Action',{'action'},criticOptions);
- Also in the sript named createDDPGNetworks.m edit line 85 to actor = rlDeterministicActorRepresentation(actorNetwork,observationInfo,actionInfo,'Observation',{'observation'},'Action',{'ActorTanh1'},actorOptions);
- Thereafter open the script titled createWalkingAgent2D.m, select the appropriate Speedup Options for your system (lines 6-8). Once changed, run this script.
Hope this helps.
Cam Salzberger
on 13 Jul 2020
Hello Sammy,
If you notice the workspace before Sebastian runs the script, it already has many variables defined. The createDDPGNetworks script is making use of some of those variables when setting up its neural networks. If you check out the createWalkingAgent2D (or 3D, I'm not sure which he was using), you can see that numObs is defined there.
-Cam
2 Comments
Cam Salzberger
on 14 Jul 2020
I'm sorry, but I'm not very experienced with the Reinforcement Learning Toolbox. However, if you do a search through the release notes for the removed function, it links to recommendations for how to replace the functionality. Hopefully this will be able to get you started.
-Cam
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!