首页 > 解决方案 > 错误:无法创建火车工作目录:catboost_info

问题描述

我一直在关注链接教程来构建 catboost 分类器模型:

https://www.analysisup.com/python-machine-learning/catboost-python-tutorial.html

代码运行良好,直到我尝试运行教程中的第 13 个命令:

model.grid_search(grid,train_dataset)

此时我收到以下错误:

CatBoostError: catboost/libs/train_lib/dir_helper.cpp:20: Can't create train working dir: catboost_info

标签: pythoncatboost

解决方案


catboost_info是 catboost 写入以跟踪日志的输出文件夹的名称(请参阅https://catboost.ai/docs/concepts/output-data.html)。

输出文件的目录在 train-dir (train_dir) 参数中指定。该参数的默认值为 catboost_info。

尝试更改您正在使用的环境以允许 catboost 写入catboost_info文件夹,或指定写入输出文件的路径。

我在 Databricks 中工作时遇到了这个问题(使用 CatBoostClassifier),我将相同的代码复制到我的个人计算机上,它在本地工作,因为它能够catboost_info在我的工作目录中写入文件夹。

多次运行模型后,您将收到 Custom logger is already specified. Specify more than one logger at same time is not thread safe.这是由于写入此 catboost_info 文件夹的记录器信息,这只是一个警告,不会影响您的建模。


catboost_info 文件夹: 单击以查看输出文件夹内的内容


推荐阅读