AttributeError: Can't get attribute 'TunerInternal._validate_overwrite_trainable' on <module 'ray.tune.impl.tuner_internal'

huangapple go评论91阅读模式
英文:

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=&quot;y&quot;,
    num_boost_round=20,
    params={
        # XGBoost specific params
        &quot;objective&quot;: &quot;binary:logistic&quot;,
        # &quot;tree_method&quot;: &quot;gpu_hist&quot;,  # uncomment this to use GPUs.
        &quot;eval_metric&quot;: [&quot;logloss&quot;, &quot;error&quot;],
    },
    datasets={&quot;train&quot;: traindata_ray},
   # preprocessor=preprocessor,
)
result = trainer.fit()
print(result.metrics)

Reference: https://docs.ray.io/en/latest/train/train.html

答案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?

huangapple
  • 本文由 发表于 2023年2月10日 02:57:53
  • 转载请务必保留本文链接:https://go.coder-hub.com/75403232.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定