danijar / dreamerv2

Mastering Atari with Discrete World Models
https://danijar.com/dreamerv2
MIT License
886 stars 195 forks source link

Docker support #3

Closed esmanchik closed 3 years ago

danijar commented 3 years ago

Thanks for the PR. Have you tested this? Would you mind adding an entry point command that actually trains the agent? I think we can also remove the shell scripts and add them as comments to the Dockerfile instead because they likely will be different for other users and only serve as examples. The Dockerfile can be in the repository root then.

esmanchik commented 3 years ago

Happy to help. Updated PR according to your comments and re-tested. Builds and runs training with the following:

docker build -t dreamer2 .
docker run --gpus all -it -p 6006:6006 -v `pwd`:/tf/host dreamer2

Also you can override the entrypoint to launch Tensorboard in the separate tmux window to monitor the training:

docker run --gpus all -it -p 6006:6006 -v `pwd`:/tf/host --entrypoint bash dreamer2
tmux
tensorboard --logdir /tf/host/logdir --bind_all
# Ctrl+b c
python3 dreamer.py --logdir /tf/host/logdir/atari_pong/dreamerv2/1 --configs defaults atari --task atari_pong