Closed bradenkinard closed 1 year ago
@bradenkinard Thanks for the easily-reproducible report! We're taking a look at this.
Yes, we can reproduce the bug. Seems to be related to hydra changing the working directory away from the source code. We're working on both a workaround, and a solution.
Here is a workaround:
import hydra
from comet_ml import Experiment
@hydra.main(config_path="configs", config_name="config")
def main(cfg):
experiment = Experiment(project_name="my_project", log_code=False)
experiment.set_code(filename=hydra.utils.to_absolute_path(__file__))
print("Hello, world")
if __name__ == "__main__":
main()
Working on a solution. Stay tuned...
Thanks. The workaround is very helpful. And thanks for the quick response on this!
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
This issue was closed because it has been stalled for 5 days with no activity.
Hydra is a popular framework for composing configuration files. Its typical usage involves using a decorator that points to your configuration yaml file on your main function. However, when this is done, Comet will fail to log the script's code.
The following is a minimal example in which the code is properly logged, as the Hydra configuration is not used:
Once the hydra is used to implement a configuration (here it is an arbitrary YAML file at
configs/config.yaml
), the code will now fail to log to Comet: