A simple argument which forces use of CPU instead of trying to load model to a GPU with possibly not enough memory.
This is especially useful on Windows where CUDA_VISIBLE_DEVICES environment variable does not work and you have GPU-enabled Tensorflow installed as it is for other purposes.
๐งช How to Test
Have GPU-enabled Tensorflow installed
Launch game with python play.py --cpu
Game should now only load model to RAM and not touch GPU devices.
Other comments
Automatic detection is also an option. However this would become brittle if, in future, the model is squeezed into smaller size (which would then fit to e.g. 8GB GPU cards).
๐ Issues resolved:
A simple argument which forces use of CPU instead of trying to load model to a GPU with possibly not enough memory.
This is especially useful on Windows where
CUDA_VISIBLE_DEVICES
environment variable does not work and you have GPU-enabled Tensorflow installed as it is for other purposes.๐งช How to Test
python play.py --cpu
Other comments
Automatic detection is also an option. However this would become brittle if, in future, the model is squeezed into smaller size (which would then fit to e.g. 8GB GPU cards).