Code Monkey home page Code Monkey logo

Comments (11)

pvcastro avatar pvcastro commented on May 25, 2024 1

Hi @himkt !
Sorry for taking so long, but I was waiting for my last tune to finish...it was running for some days.

I just tried running it again without specifying any parameters, and now the error is this:

Traceback (most recent call last):
  File "/opt/conda/envs/allennlp/bin/allennlp", line 8, in <module>
    sys.exit(run())
  File "/opt/conda/envs/allennlp/lib/python3.8/site-packages/allennlp/__main__.py", line 34, in run
    main(prog="allennlp")
  File "/opt/conda/envs/allennlp/lib/python3.8/site-packages/allennlp/commands/__init__.py", line 119, in main
    args.func(args)
  File "/opt/conda/envs/allennlp/lib/python3.8/site-packages/allennlp_datalawyer/tune/tune_cv.py", line 158, in tune_cv
    study.optimize(objective_cv, n_trials=n_trials, timeout=timeout)
  File "/opt/conda/envs/allennlp/lib/python3.8/site-packages/optuna/study.py", line 400, in optimize
    _optimize(
  File "/opt/conda/envs/allennlp/lib/python3.8/site-packages/optuna/_optimize.py", line 66, in _optimize
    _optimize_sequential(
  File "/opt/conda/envs/allennlp/lib/python3.8/site-packages/optuna/_optimize.py", line 163, in _optimize_sequential
    trial = _run_trial(study, func, catch)
  File "/opt/conda/envs/allennlp/lib/python3.8/site-packages/optuna/_optimize.py", line 268, in _run_trial
    raise func_err
  File "/opt/conda/envs/allennlp/lib/python3.8/site-packages/optuna/_optimize.py", line 217, in _run_trial
    value_or_values = func(trial)
  File "/opt/conda/envs/allennlp/lib/python3.8/site-packages/allennlp_datalawyer/tune/tune_cv.py", line 117, in _objective_cv
    train_loop = TrainModel.from_params(
  File "/opt/conda/envs/allennlp/lib/python3.8/site-packages/allennlp/common/from_params.py", line 589, in from_params
    return retyped_subclass.from_params(
  File "/opt/conda/envs/allennlp/lib/python3.8/site-packages/allennlp/common/from_params.py", line 623, in from_params
    return constructor_to_call(**kwargs)  # type: ignore
  File "/opt/conda/envs/allennlp/lib/python3.8/site-packages/allennlp/commands/train.py", line 729, in from_partial_objects
    trainer_ = trainer.construct(
  File "/opt/conda/envs/allennlp/lib/python3.8/site-packages/allennlp/common/lazy.py", line 80, in construct
    return self.constructor(**contructor_kwargs)
  File "/opt/conda/envs/allennlp/lib/python3.8/site-packages/allennlp/common/lazy.py", line 64, in constructor_to_use
    return self._constructor.from_params(  # type: ignore[union-attr]
  File "/opt/conda/envs/allennlp/lib/python3.8/site-packages/allennlp/common/from_params.py", line 589, in from_params
    return retyped_subclass.from_params(
  File "/opt/conda/envs/allennlp/lib/python3.8/site-packages/allennlp/common/from_params.py", line 623, in from_params
    return constructor_to_call(**kwargs)  # type: ignore
  File "/opt/conda/envs/allennlp/lib/python3.8/site-packages/allennlp/training/trainer.py", line 1068, in from_partial_objects
    callbacks_.append(callback_.construct(serialization_dir=serialization_dir))
  File "/opt/conda/envs/allennlp/lib/python3.8/site-packages/allennlp/common/lazy.py", line 80, in construct
    return self.constructor(**contructor_kwargs)
  File "/opt/conda/envs/allennlp/lib/python3.8/site-packages/allennlp/common/lazy.py", line 64, in constructor_to_use
    return self._constructor.from_params(  # type: ignore[union-attr]
  File "/opt/conda/envs/allennlp/lib/python3.8/site-packages/allennlp/common/from_params.py", line 589, in from_params
    return retyped_subclass.from_params(
  File "/opt/conda/envs/allennlp/lib/python3.8/site-packages/allennlp/common/from_params.py", line 623, in from_params
    return constructor_to_call(**kwargs)  # type: ignore
  File "/opt/conda/envs/allennlp/lib/python3.8/site-packages/optuna/_experimental.py", line 90, in wrapped_init
    _original_init(self, *args, **kwargs)
  File "/opt/conda/envs/allennlp/lib/python3.8/site-packages/optuna/integration/allennlp.py", line 464, in __init__
    study = load_study(study_name, storage, pruner=_create_pruner())
  File "/opt/conda/envs/allennlp/lib/python3.8/site-packages/optuna/integration/allennlp.py", line 95, in _create_pruner
    return pruner(**pruner_params)
  File "/opt/conda/envs/allennlp/lib/python3.8/site-packages/optuna/pruners/_successive_halving.py", line 121, in __init__
    raise ValueError(
ValueError: The value of `min_resource` is None, but must be either `min_resource` >= 1 or 'auto'

from allennlp-optuna.

pvcastro avatar pvcastro commented on May 25, 2024 1

Sure @himkt , fine by me.

from allennlp-optuna.

himkt avatar himkt commented on May 25, 2024

Hello @pvcastro! Thank you so much for trying allennlp-optuna.
As you pointed out, allennlp-optuna currently doesn't allow users to specify samplers/pruners without attributes.
After #40 being merged, you can use a sampler or pruner with the configuration you shared.

from allennlp-optuna.

himkt avatar himkt commented on May 25, 2024

#40 was merged. You can skip specifying attributes from the next release of allennlp-optuna.

from allennlp-optuna.

pvcastro avatar pvcastro commented on May 25, 2024

Great, thanks @himkt !
As soon as my current search finishes, I'll try this new version.

from allennlp-optuna.

himkt avatar himkt commented on May 25, 2024

I released allennlp-optuna v0.1.6 just now. It fixes the problem!

https://github.com/himkt/allennlp-optuna/releases/tag/v0.1.6

from allennlp-optuna.

himkt avatar himkt commented on May 25, 2024

Hmm, sorry for the inconvenience.
Can you share your config file you used? (optuna param file (json) and allennlp config file (jsonnet))

from allennlp-optuna.

himkt avatar himkt commented on May 25, 2024

@pvcastro

from allennlp-optuna.

pvcastro avatar pvcastro commented on May 25, 2024

Hi @himkt !

optuna.json was just:

{
    "pruner": {
        "type": "SuccessiveHalvingPruner"
    }
}

the callback config from jsonnet was:

callbacks: [
            {
                type: 'optuna_pruner'
            }
        ],

Do you think you need the whole config file? I'm thinking these should be enough, right?

from allennlp-optuna.

himkt avatar himkt commented on May 25, 2024

@pvcastro

Thank you for sharing the configurations. I identified the cause, and I'm working on fixing it.
Can we close this issue and move to #39 for further discussion?

from allennlp-optuna.

himkt avatar himkt commented on May 25, 2024

Thank you! Let me close it.

from allennlp-optuna.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.