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

HyperParameterOptimizer fails because bask task hyper parameters types are not copied over #975

Open
reiffd7 opened this issue Apr 12, 2023 · 8 comments
Labels
bug Something isn't working

Comments

@reiffd7
Copy link

reiffd7 commented Apr 12, 2023

Describe the bug

When I run HyperParameterOptimizer from clearml.automation, each child "experiment" task fails because the hyper parameter types are not copied over correctly. Each type for the hyper parameters is converted to strings.

base task:

GENERAL

batch_size 100 //type Int

optimization task:

GENERAL

batch_size 100 //type String

To reproduce

Just followed the tutorial @ https://github.com/allegroai/clearml/blob/master/examples/optimization/hyper-parameter-optimization/hyper_parameter_optimizer.py

but replaced the base task id with one of my tasks.

Expected behaviour

I would expect the correct hyper parameter types to copy over from the base task to the hyper parameter search child task. I know that task.get_parameters() has a cast parameter that can be used to retrieve the correct types, but this does not seem to be an option when conducting a hyper parameter search. I was able to fix the issue locally by editing clearml/automation/job.py.
In line 410:
hyper_params = task.get_parameters(cast=True) if params_override is None else params_override
In line 541:
task_params = base_temp_task.get_parameters(cast=True, backwards_compatibility=False)

But, I would like to be able to pass cast=True to the HyperParameterOptimizer method.

Environment

  • Server type (self hosted \ app.clear.ml): app.clear.ml
  • ClearML SDK Version: 1.10.3
  • Python Version: 3.7.16
  • OS (Windows \ Linux \ Macos): Linux
@reiffd7 reiffd7 added the bug Something isn't working label Apr 12, 2023
@phineasng
Copy link

Any update on this, or did you manage to find a less invasive workaround by any chance @reiffd7 ?

@AlexandruBurlacu
Copy link

Hello @reiffd7 and @phineasng, sorry for taking such long time. I believe we solved this issue (wrong casting of configuration values) in more recent ClearML versions. Try to install the latest version, which is 1.11.0, and please let us know whether it solves the bug

@wxdrizzle
Copy link

Hi @AlexandruBurlacu , seems that in recent version this problem still exists. I created a new issue #1238 for this several days ago and today just found this issue is exactly what I have.

@eugen-ajechiloae-clearml
Copy link
Collaborator

eugen-ajechiloae-clearml commented Apr 15, 2024

Hi @wxdrizzle @reiffd7 ! We have prepared a fix for this issue and we will soon release it.

@wxdrizzle
Copy link

Hi @wxdrizzle @reiffd7 ! We have prepared a fix for this issue and we will soon release it.

Happy to know this. Thank you! I'll update once I can try the new release.

@eugen-ajechiloae-clearml
Copy link
Collaborator

Hi @reiffd7 @phineasng @wxdrizzle ! We have released an RC (and we will soon release an official version) that addresses this issue. Can you please try it out? To install it, do pip install clearml==1.16.0rc0

@wxdrizzle
Copy link

Hi @reiffd7 @phineasng @wxdrizzle ! We have released an RC (and we will soon release an official version) that addresses this issue. Can you please try it out? To install it, do pip install clearml==1.16.0rc0

Hi @eugen-ajechiloae-clearml , I tried this and confirm that in my case it solved the problem perfectly. I'll close my issue. Thank you so much!!!

@pollfly
Copy link
Contributor

pollfly commented May 19, 2024

Hey @reiffd7! Just letting you know that this issue has been resolved in the recently released v1.16.0. Let us know if there are any issues :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants