question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Tune] Access trial name from within trainable class

See original GitHub issue

It would be useful to be able to access the trial name from within a Trainable.

Current solution:

class RayWorker(tune.Trainable):
    def _setup(self, config):
        self.trial_name = self._logdir.split('/')[-1].split('_')[0]

However this will only work when the default logging setup is used

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
richardliawcommented, Apr 21, 2020

You can now access the trial name in the trainable.

0reactions
LianShuaiLongcommented, Dec 1, 2020

you can access trial name via self.trial_name

cool!!!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Training (tune.Trainable, session.report) — Ray 2.2.0
The Function API allows you to define a custom training function that Tune will run in parallel Ray actor processes, one for each...
Read more >
Hyperparameter tuning with Ray Tune - PyTorch
Ray Tune is an industry standard tool for distributed hyperparameter tuning. ... The selected number of GPUs are made visible to PyTorch in...
Read more >
tune.py - ray-project/ray - Sourcegraph
getLogger(__name__) ... trainable function or class registered in the tune registry. ... identifier (such as `Trial.trial_id`) in each trial's name.
Read more >
python - Ray Tune error when using Trainable class with tune ...
Can you try upgrading Ray? The latest version is 1.4.1, and the docs you linked are from latest master. In 1.2.0, tune.with_parameters only ......
Read more >
Simple hyperparameter and architecture search in tensorflow ...
import ray.tune as tune class Model: # TODO implement class ... model # Hyperparameters for this trial can be accessed in dictionary ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found