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

1 次查看(过去 30 天)
%% 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?

回答(1 个)

Mahesh Taparia
Mahesh Taparia 2020-5-15
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 个评论
Wenkai Wu
Wenkai Wu 2020-8-27
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.

请先登录,再进行评论。

Community Treasure Hunt

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

Start Hunting!

Translated by