Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not thread safe #181

Open
Dawars opened this issue Feb 27, 2023 · 2 comments
Open

Not thread safe #181

Dawars opened this issue Feb 27, 2023 · 2 comments

Comments

@Dawars
Copy link

Dawars commented Feb 27, 2023

When I use gin config for hyperparameter search with optuna and it starts multiple processes at the same time I get the following error:
Attempted to modify locked Gin config

This is because internally gin stores the configs in global variables.

Is there a way to fix this?

@jingnanshi
Copy link

You should be able to avoid this by doing something similar to this: https://gist.github.com/sile/1158ba37ff5b8c290f8953acebffed80. Essentially you want to have a separate gin config for each process.

@Criswim
Copy link

Criswim commented Dec 2, 2024

@Dawars have you fixed your problem? I also get the error 'Attempted to modify locked Gin config' when I run my code. I want to use the same .gin file in each iteration.
According to the suggestion from @jingnanshi , I have tried to make a copy of the .gin file with a new name in each iteration and then use the gin.parse_config_files_and_bindings() function, but it didn't work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants