remove saving model as a pickle file in ppo2 (tries to pull environment in; bad idea - may need to use constructor argument pickling or somesuch if at all necessary) (#69)
This commit is contained in:
@@ -227,10 +227,6 @@ def learn(*, network, env, total_timesteps, seed=None, nsteps=2048, ent_coef=0.0
|
|||||||
make_model = lambda : Model(policy=policy, ob_space=ob_space, ac_space=ac_space, nbatch_act=nenvs, nbatch_train=nbatch_train,
|
make_model = lambda : Model(policy=policy, ob_space=ob_space, ac_space=ac_space, nbatch_act=nenvs, nbatch_train=nbatch_train,
|
||||||
nsteps=nsteps, ent_coef=ent_coef, vf_coef=vf_coef,
|
nsteps=nsteps, ent_coef=ent_coef, vf_coef=vf_coef,
|
||||||
max_grad_norm=max_grad_norm)
|
max_grad_norm=max_grad_norm)
|
||||||
if save_interval and logger.get_dir():
|
|
||||||
import cloudpickle
|
|
||||||
with open(osp.join(logger.get_dir(), 'make_model.pkl'), 'wb') as fh:
|
|
||||||
fh.write(cloudpickle.dumps(make_model))
|
|
||||||
model = make_model()
|
model = make_model()
|
||||||
if load_path is not None:
|
if load_path is not None:
|
||||||
model.load(load_path)
|
model.load(load_path)
|
||||||
|
Reference in New Issue
Block a user