8000 TypeError: Descriptors cannot not be created directly. · Issue #36417 · ray-project/ray · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
TypeError: Descriptors cannot not be created directly. #36417
Open
@FrancescoMandru

Description

@FrancescoMandru

I was running your example code after upgrading to ray 2.5.0, but now I get the following error.

TypeError: Descriptors cannot not be created directly.
If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0.
If you cannot immediately regenerate your protos, some other possible workarounds are:

  1. Downgrade the protobuf package to 3.20.x or lower.
  2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).

I don't understand why I have to downgrade protobuf ti much older versions. Any suggestion? This error disappear if I use older versions of Ray

Versions / Dependencies

ray = {extras = ["tune"], version = "^2.5.0"}
python = "^3.10"

Reproduction script

from ray import tune

def objective(config): # ①
score = config["a"] ** 2 + config["b"]
return {"score": score}

search_space = { # ②
"a": tune.grid_search([0.001, 0.01, 0.1, 1.0]),
"b": tune.choice([1, 2, 3]),
}

tuner = tune.Tuner(objective, param_space=search_space) # ③

results = tuner.fit()
print(results.get_best_result(metric="score", mode="min").config)

Issue Severity

Medium: It is a significant difficulty but I can work around it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issue, but not time-criticalbugSomething that is supposed to be working; but isn'tcoreIssues that should be addressed in Ray Corestability

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0