Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Trails did not complete error #257

Open
Bk073 opened this issue Apr 18, 2023 · 0 comments
Open

Trails did not complete error #257

Bk073 opened this issue Apr 18, 2023 · 0 comments

Comments

@Bk073
Copy link

Bk073 commented Apr 18, 2023

I wanted to do distributed hyperparameter tuning. And I am getting trials did not complete error

import lightning as pl
from ray import air, tune
from ray_lightning import RayStrategy
from ray_lightning.tune import TuneReportCallback, get_tune_resources


def main(config):
     model = LighteningModel(config)

      callback = TuneReportCallback(
        {
            "val_loss": "val_total_loss",
        },
        on="validation_end")

        trainer = pl.Trainer(max_epochs=4, callbacks=[callbacks],
                         strategy=RayStrategy(num_workers=1, use_gpu=False))
         trainer.fit(model, train_dataloader, val_dataloader)


def train():
     search_space = {
                'lr': tune.choice([1e-2, 1e-3, 1e-4])
             }
       num_samples=1

       tuner = tune.Tuner(
             tune.with_resources(
              main,
              get_tune_resources(num_workers=1, use_gpu=False),
           ),
             param_space=search_space,
    )
    results = tuner.fit()
   

I am following these two links.

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

No branches or pull requests

1 participant