Trainer.hyperparameter_search doesn't work for me

HI, as a beginner I try to follow few examples. Looking at this repo " Fine-tuning a model on a text classification task " (here - I tried to implement the trainer.hyperparameter_search() method with either “optuna” and “ray [tune]” .

!pip install optuna --> seems to work fine
When running the example shown I keep getting:

RuntimeError: At least one of optuna or ray should be installed. To install optuna run pip install optuna.To install ray run pip install ray[tune].

I tried installing both but none works… any guidance would be highly appreciated…

thanks, -Ofer

There is some environment problem it seems, since transformers didn’t detect you have optuna installed. I’d try restarting your kernel since you seem to be in a notebook.

Yap… indeed, simple and worked. Thanks