imitation
imitation copied to clipboard
Replace `_save_dagger_demo` by `types.save`
Problem
In algorithms/dagger.py
, there is a function called _save_dagger_demo
that saves trajectories in .npz
format. This is redundant with the save
function in data/types.py
which also saves trajectories in .npz
format. Apparently when _save_dagger_demo
was written, types.save
used pickle
rather than NPZ, and only accepted TrajectoryWithRew
s, both of which are no longer true.
Solution
Rewrite _save_dagger_demo
to use types.save
.
Possible alternative solutions
Make it more clear why _save_dagger_demo
is importantly different to types.save
, if it indeed is.
From a quick skim this does indeed seem redundant and these methods could probably be removed now. @Rocamonde do you mind making a PR to address this issue?
See https://github.com/HumanCompatibleAI/imitation/issues/556 for a related issue.