baselines icon indicating copy to clipboard operation
baselines copied to clipboard

How to use evaluate mode of GAIL?

Open Weiyi-Zhang258 opened this issue 5 years ago • 5 comments

I've finished training and get a model like this: image When I set the args like this: parser.add_argument('--load_model_path', help='if provided, load the model', type=str, default='G:/Anaconda/envs/zwy/Lib/site-packages/baselines-master/baselines-master/baselines/gail/checkpoint/trpo_gail.transition_limitation_-1.Hopper/trpo_gail.transition_limitation_-1.Hopper') It does not work. What args should I write to load it?

Weiyi-Zhang258 avatar Dec 04 '19 06:12 Weiyi-Zhang258

me, too. It told me the string I give is a directory. Should I give path of one of these three?

Kailiangdong avatar May 08 '20 13:05 Kailiangdong

Hello, I also have this problem. Could you tell me how you solved it?

Su-Lemon avatar Aug 14 '20 04:08 Su-Lemon

Hello, I also have this problem. Could you tell me how you solved it?

Su-Lemon avatar Aug 14 '20 04:08 Su-Lemon

parser.add_argument('--load_model_path', help='if provided, load the model', type=str, default='./baselines/checkpoint/BC.commonroad.traj_limitation_-1.seed_1')

ob_space = env.observation_space ac_space = env.action_space pi = policy_func("pi", ob_space, ac_space, reuse=reuse) variables = tf.contrib.framework.get_variables_to_restore() variables_to_restore = [v for v in variables if v.name.split('/')[0]=='pi'] saver = tf.train.Saver(variables_to_restore) saver.restore(tf.get_default_session(), tf.train.latest_checkpoint(load_model_path))

Kailiangdong avatar Aug 14 '20 07:08 Kailiangdong

Thanks for your tips. It solved this problem well. I understand that the reason for the problem is that the saved model is a collection of files generated by tensorflow, but when loading the model in U.load_variables(load_model_path), joblib.load is used

Su-Lemon avatar Aug 14 '20 09:08 Su-Lemon