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 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(2 个)
Yahya Madhi
2020-9-27
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
2020-7-13
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 个评论
Cam Salzberger
2020-7-14
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
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Sequence and Numeric Feature Data Workflows 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!