Raytune tune.choice Typeerror: int() argument must be a string, a bytes-like object or a number, not 'Categorical'

354 views Asked by At

I am trying hyperparameter tuning using Ray-tune.

current my tune_config is shown in below code

self.tune_config = {
    "batch_size": tune.choice([128, 256, 512]),
    "epoch": tune.choice([50, 100, 200]),
    "sequence_length": tune.choice([128, 256]),
}

and when I apply this config as below code, the error occurs

if config.tune:
    self.batch_size = int(tune_config["batch_size"])
    self.sequence_length = int(tune_config["sequence_length"])

enter image description here

I referenced this link (https://docs.ray.io/en/latest/tune/tutorials/tune-pytorch-cifar.html#tune-pytorch-cifar-ref)

How can I apply tune.choice options to integer?

Sorry for my poor English skills and thanks for reading.

0

There are 0 answers