Closed littleV closed 4 years ago
Hi,
Do you use conda? Does this happen every time and for all games?
I can't reproduce it on a fresh installation with pip on linux in a python3 virtual environment.
It seems to be related to the shutdown of Ray. Maybe replacing ray.shutdown() with:
shared_storage_worker.__ray_kill__()
replay_buffer_worker.__ray_kill__()
test_worker.__ray_kill__()
for worker in self_play_workers:
worker.__ray_kill__()
ray.shutdown()
will solve it.
Hi @werner-duvaud
I have two laptops, only one has the issue. I'll try your method.
Btw, I might be able to train gomoku game on AWS, working on a strategy to lower the cost.
Also testing around adding new games. So I'm trying to use abstract classes to standardize the creation of a game. Is this something you would be interested in adding to the project? I'll be using python3 syntax. If not, I'll drop the project and just using what's available now.
Thanks!
Hi,
About the bug, do you have an idea of the difference between your laptops that could cause the bug ?
For AWS, it's great. Don't hesitate if you need help.
We are interested in adding abstract class, do not hesitate to do a PR.
Thanks
Hi @werner-duvaud,
I don't have the other laptop with me now to tell you the differences. I'll update once I have the info.
Here's some more information:
I'm new to ray, to run this project, how do I make sure the training happens on GPU? And does the test episodes have to happen on GPU?
I want to set up a project training on GPU and when it's done copy the model to a CPU only machine for playing, thus saving the resources.
Hi,
Ok, it might be interesting to revert the last commit to see if the bug is related to it.
In the __init__
of Ray actors we specify whether the model should be on the CPU or the GPU. The training part takes place on the GPU if there is one, the self play part takes place on the CPU. You can check it by displaying next(self.model.parameters()).is_cuda
in the corresponding Ray actors.
Normally test episodes take place on CPU since it is a kind of self-play.
If you have a GPU the training_device
parameter in the config should be "cuda"
and the model will be trained on GPU. The model is automatically saved.
To use a model, just copy model.weights and load it with the load pretrained model option then render some self play. It should also work on CPU even if the model has been trained on GPU.
Hi @werner-duvaud
When I'm running the latest code I always get an error when exiting the process. Please see attached screen output below:
I did delete old repo and had a fresh check out, still seeing this.
so I did some research, found this: https://github.com/ray-project/ray/issues/5042 and this: https://github.com/ray-project/ray/issues/6239 Hope it can help you.