imitation icon indicating copy to clipboard operation
imitation copied to clipboard

Replace `_save_dagger_demo` by `types.save`

Open dfilan opened this issue 2 years ago • 2 comments

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 TrajectoryWithRews, 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.

dfilan avatar Sep 09 '22 21:09 dfilan

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?

AdamGleave avatar Sep 09 '22 22:09 AdamGleave

See https://github.com/HumanCompatibleAI/imitation/issues/556 for a related issue.

dfilan avatar Sep 09 '22 23:09 dfilan