nicklashansen / tdmpc2

Code for "TD-MPC2: Scalable, Robust World Models for Continuous Control"
https://www.tdmpc2.com
MIT License
343 stars 71 forks source link

[FIXED] TypeError: Can't instantiate abstract class SliceSampler with abstract methods load_state_dict, state_dict #29

Closed Ozzey closed 3 months ago

Ozzey commented 4 months ago

Error: The error was caused by torch-rl introducing new abstract methods in Sample class: load_state_dict, state_dict

Fix: Overloading both methods in SliceSampler in common/sample.py

Branch: episodic-rl

Related Issues: Mentioned here

nicklashansen commented 3 months ago

@Ozzey Thank you for submitting this pull request. I have removed the removed the standalone sampler code in favor of the torchrl version now that it has been fully integrated into their stable release, so I believe this fix is no longer necessary. Closing this PR but feel free to comment/reopen if you feel that it is still relevant!