Ray Tune日志同时写入默认与自定义目录问题咨询
Ray Tune 同时写入两个日志目录的原因及解决办法
原因
storage_path参数的设计目的是用于**云存储(如S3、GCS等)**的日志同步,而非修改本地默认日志目录。当你指定该参数时,Ray Tune会将日志同步到你设置的storage_path路径,同时保留本地默认的~/ray_results作为本地缓存目录,因此会出现两个目录都生成日志的情况。
解决办法
要修改本地日志的存储目录,需使用RunConfig中的local_dir参数替代storage_path,调整后的代码如下:
timestamp = datetime.datetime.now().strftime("%Y-%m-%d_%H-%M-%S") experiment_name = f"doc2vec-experiemt_{timestamp}" tuner = tune.Tuner( tune.with_resources(train_model, {"cpu":4}), param_space=search_space, run_config=air.RunConfig(local_dir="my_custom_folder_results/", name=experiment_name), tune_config=tune.TuneConfig(num_samples=20), )
这样设置后,Ray Tune会将所有试验日志仅写入你指定的my_custom_folder_results/目录,不再生成默认的~/ray_results目录。
内容的提问来源于stack exchange,提问作者LearnToGrow
相关产品推荐
相关产品推荐

