Is the error stated below a result of using a different version of MATLAB than the one the code in question was created with?
조회 수: 8 (최근 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
Lanh Van Nguyen
2020년 7월 28일
Hi Sammy. I have the same error as yours. Have you fixed the problem yet?
답변 (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
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!