Comments (11)
Hello @pvcastro, please give me some time to investigate it.
(It should be a bug in allennlp-optuna
, sorry for the inconvenience.)
from allennlp-optuna.
@pvcastro Could you please upgrade allennlp-optuna and check if the error still happens?
what exactly is a "resource"
min_resource
controls a computation budget for each trial.
The smaller min_resource
is, the more likely pruning will occur.
If you want to learn more detail, please refer to the original paper or ask Optuna dev team on gitter.
from allennlp-optuna.
Hi @himkt !
Leaving "auto" for min_resource is still throwing the same exception after upgrading to 0.1.6.
from allennlp-optuna.
Finally, I found the root cause.
Optuna pruning integration for AllenNLP creates a pruner using environment variables.
If a value None
(None object) is specified in config, it would be parsed as "None" (string literal) when constructing a pruner. It causes the problem you encountered.
(Pdb) _get_environment_variables_for_pruner()
{'min_resource': 'None', 'reduction_factor': 4, 'min_early_stopping_rate': 0}
https://github.com/optuna/optuna/blob/master/optuna/integration/allennlp.py#L74-L95
I'll make a PR to avoid this problem.
But for now, could you please specify min_resource
to be "auto"
explicitly in your configuration?
from allennlp-optuna.
from allennlp-optuna.
Hi @himkt , as I stated here, leaving "auto" still causes the issue. The "auto" value is being ignored, for some reason.
from allennlp-optuna.
I was doing some debugging, and I think the problem is that at this line at optuna, they don't save the "auto" value, they only save a value if it's an integer. And whey you retrieve the pruner attributes from the environment variables in the method you mentioned, the min_resource is None, and when you try to instantiate a new one with None, it throws the exception.
from allennlp-optuna.
Oh, you're right, thank you.
I now understand the problem is happened due to the mismatch between min_resource
and _min_resource
.
As you pointed out, SuccessiveHalvingPruner doesn't preserve the min_resource
when it is not integer.
I'll discuss how to restore a pruner from attributes such as _min_resource
(slightly different from the original min_resource
) with Optuna dev team, sorry but please wait.
from allennlp-optuna.
Sure, glad to help!
from allennlp-optuna.
Sorry for being late @pvcastro. I resolved this problem in optuna/optuna#2731.
Please run pip uninstall optuna
and run pip install 'optuna@git+https://github.com/optuna/optuna@master'
on your environment. (This fix will be included in the next version of Optuna)
from allennlp-optuna.
Closed as this fix was shipped in Optuna v2.9.0.
from allennlp-optuna.
Related Issues (17)
- include package is not being passed during distributed training HOT 10
- PruningCallback doesn't work HOT 6
- Erroneous poetry run commands?
- Clarify License HOT 2
- AllenNLP v2
- jsonnet_evaluate_file HOT 13
- retrain runtime error: fail to load study HOT 2
- Question: hyperparameter tuner for allennlp with cross-validation HOT 12
- KeyError: 'attributes' for optuna-param-path config file HOT 11
- retrain command not getting environment values HOT 4
- Trials with repeated set of hyperparameters HOT 4
- Different results from `allennlp tune` and `allennlp retrain` with transformers HOT 4
- Support multi-objective optimization
- Passing overrides to tune command? HOT 1
- Trial X failed because of the following error: ValueError('nan loss encountered') HOT 3
- Provide default/good hyperparameters to start search HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from allennlp-optuna.