reinforcement learning toolbox ---fail to train stores saved agents in a MAT-file in the folder

1 view (last 30 days)
%% Train Agent
doTraining = false;
if doTraining
% Train the agent
trainingStats = train(agent,env,trainOpts);
else
% Load pretrained agent for the example
load('Agent512.mat','agent')
end
warning: Variable 'agent' not found
but the demo 'rlQuadrupedAgent.mat' is ok, why? how it works correctly and allow me to test candidate agents generated during a long-running training process?

Answers (1)

Mahesh Taparia
Mahesh Taparia on 15 May 2020
Hi
There is in built agent file named rlQuadrupedAgent.mat in MATLAB directory. But there is no file named as Agent512.mat. You have to save any model file in your current working directory with that name. So the below command will work:
load('rlQuadrupedAgent.mat','agent')
  1 Comment
Wenkai Wu
Wenkai Wu on 27 Aug 2020
Hi, i met the same problem, the solution still can't work in my case. Because the saved agent 'Agent512.mat' is created by the command 'SaveAgentCriteria', it is saved in the folder 'savedAgents' by default, then i followed your steps: copy the agent into the current folder and rename it as 'rlQuadrupedAgent.mat'. But that warnings still came up and can't work to see the trained reasult.
Really appreciate any ideas to solve this staff.

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!