英文:
AttributeError: Can't get attribute 'TunerInternal._validate_overwrite_trainable' on <module 'ray.tune.impl.tuner_internal'
问题
当我尝试在我们的服务器上运行基本的Ray模型时,Tune代码出现了问题。我不明白问题所在,也没有在互联网上找到有用的信息。有人可以帮助我吗?顺便说一下,当我在我本地机器上设置的本地ray集群中运行时,它们能够正常运行。
AttributeError: 无法获取<module'ray.tune.impl.tuner_internal' from '/home/ray/anaconda3/lib/python3.7/site-packages/ray/tune/impl/tuner_internal.py'>上的属性'TunerInternal._validate_overwrite_trainable'。
import ray
from ray.air.config import ScalingConfig
from ray.train.xgboost import XGBoostTrainer
trainer = XGBoostTrainer(
scaling_config=ScalingConfig(
# 用于数据并行的工作进程数。
num_workers=2,
# 是否使用GPU加速。
use_gpu=False,
),
label_column="y",
num_boost_round=20,
params={
# XGBoost特定参数
"objective": "binary:logistic",
# "tree_method": "gpu_hist", # 取消注释以使用GPU。
"eval_metric": ["logloss", "error"],
},
datasets={"train": traindata_ray},
# 预处理器=preprocessor,
)
result = trainer.fit()
print(result.metrics)
参考链接:https://docs.ray.io/en/latest/train/train.html
英文:
When I am trying to run a Basic Ray Model in our server, Tune Code is breaking. I didnt understand the issue and I didnt find any useful information in internet. Can any one help me with it. FYI, I am able to run them properly when I use local ray cluster which I setup in my local machine.
AttributeError: Can't get attribute 'TunerInternal._validate_overwrite_trainable' on <module 'ray.tune.impl.tuner_internal' from '/home/ray/anaconda3/lib/python3.7/site-packages/ray/tune/impl/tuner_internal.py'>
import ray
from ray.air.config import ScalingConfig
from ray.train.xgboost import XGBoostTrainer
trainer = XGBoostTrainer(
scaling_config=ScalingConfig(
# Number of workers to use for data parallelism.
num_workers=2,
# Whether to use GPU acceleration.
use_gpu=False,
),
label_column="y",
num_boost_round=20,
params={
# XGBoost specific params
"objective": "binary:logistic",
# "tree_method": "gpu_hist", # uncomment this to use GPUs.
"eval_metric": ["logloss", "error"],
},
datasets={"train": traindata_ray},
# preprocessor=preprocessor,
)
result = trainer.fit()
print(result.metrics)
答案1
得分: 1
这可能是由于 ray
版本不匹配导致的。 _validate_overwrite_trainable
在夜间版本中可用,但不在最新的 2.2.0
发行版中提供。
您可以验证一下您是否在本地机器和集群中使用相同版本的 ray
?
英文:
This is likely due to a ray
version mismatch. _validate_overwrite_trainable
is available in nightly wheels but not in the latest 2.2.0
release.
Can you verify that you are using the same version of ray
across your local machine and cluster?
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论