You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when i use python python/gps/gps_main.py box2d_pointmass_pigps_example --resume 5, some errors occur.
when i check the implementation, i found the reason in policy_opt_tf.py.
defsave_model(self, fname):
print"self.sess:", self.sessprint"fname generated by NamedTemporaryFile:", fnameLOGGER.debug('Saving model to: %s', fname)
path=self.saver.save(self.sess, fname, write_meta_graph=False)
print"file path to the saver:", path# sys.exit(("exit from policy_opt_tf.py/save_model"))defrestore_model(self, fname):
self.saver.restore(self.sess, fname)
LOGGER.debug('Restoring model from: %s', fname)
# For pickling.def__getstate__(self):
withtempfile.NamedTemporaryFile('w+b', delete=True) asf:
self.save_model(f.name) # TODO - is this implemented.f.seek(0)
withopen(f.name, 'r') asf2:
wts=f2.read() # this is an empty fileprint"wts:", wts# import syssys.exit()
return {
'hyperparams': self._hyperparams,
'dO': self._dO,
'dU': self._dU,
'scale': self.policy.scale,
'bias': self.policy.bias,
'tf_iter': self.tf_iter,
'x_idx': self.policy.x_idx,
'chol_pol_covar': self.policy.chol_pol_covar,
'wts': wts,
}
# For unpickling.def__setstate__(self, state):
print"state:", statefromtensorflow.python.frameworkimportopsops.reset_default_graph() # we need to destroy the default graph before re_init or checkpoint won't restore.self.__init__(state['hyperparams'], state['dO'], state['dU'])
self.policy.scale=state['scale']
self.policy.bias=state['bias']
self.policy.x_idx=state['x_idx']
self.policy.chol_pol_covar=state['chol_pol_covar']
self.tf_iter=state['tf_iter']
withtempfile.NamedTemporaryFile('w+b', delete=True) asf:
print"we restore tf networks in file:", f.nameprint"state['wts']:", state['wts']
f.write(state['wts'])
f.seek(0)
self.restore_model(f.name)
when i print wts, i found that wts is None. three files will be generated when we use saver.save(),they are checkpoint, *.index and *.data-*. so the file f2 is empty. how can we fix this bug?
The text was updated successfully, but these errors were encountered:
when i use
python python/gps/gps_main.py box2d_pointmass_pigps_example --resume 5
, some errors occur.when i check the implementation, i found the reason in
policy_opt_tf.py
.when i
print wts
, i found that wts is None. three files will be generated when we usesaver.save()
,they arecheckpoint
,*.index
and*.data-*
. so the filef2
is empty. how can we fix this bug?The text was updated successfully, but these errors were encountered: