rlcode / reinforcement-learning

Minimal and Clean Reinforcement Learning Examples

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Saving QLearning Agent

mvrozanti opened this issue · comments

First of all, great tutorials! I've been basing my own projects with this repo to better understand RL but through the process I found that persisting the QLearning Agent turns out to be really difficult because of it's final size.

I tried pickle, json, jsonpickle, cPickle, marshal, klepto, dbm and finally h5py and I noticed it might not be as easy as it seems, because none of these worked. My 64-bit Linux Mint system kills the process and leaves a 0 bytes file where the q_table should be.

It actually works, rewards getting better and all but if it's trained to a point it becomes impossible to persist it back to disk, it seems. I tried creating swap space from the intuition that it was running out of memory, to no avail.

Would be glad if anyone has a fix for this. Thanks!