Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ray-crash-course/06-Exploring-Ray-API-Calls.ipynb there is an incorrect API parameter #47

Open
japsonzbz opened this issue Jun 2, 2021 · 0 comments

Comments

@japsonzbz
Copy link
Contributor

In part @ray.remote(),the argument named num_return_vals is different from that in the Ray Docs.

When I execute the sample code given in notebook:

@ray.remote(num_return_vals=3)
def tuple3(one, two, three):
    return (one, two, three)
...

The following error will appear:

---------------------------------------------------------------------------
AssertionError                            Traceback (most recent call last)
<ipython-input-9-05124ba20d56> in <module>
----> 1 @ray.remote(num_return_vals=3)
      2 def tuple3(one, two, three):
      3     return (one, two, three)
      4 
      5 x_ref, y_ref, z_ref = tuple3.remote("a", 1, 2.2)

~/opt/anaconda3/envs/anyscale-academy/lib/python3.7/site-packages/ray/worker.py in remote(*args, **kwargs)
   1926             "max_task_retries",
   1927             "max_retries",
-> 1928         ], error_string
   1929 
   1930     num_cpus = kwargs["num_cpus"] if "num_cpus" in kwargs else None

AssertionError: The @ray.remote decorator must be applied either with no arguments and no parentheses, for example '@ray.remote', or it must be applied using some of the arguments 'num_returns', 'num_cpus', 'num_gpus', 'memory', 'object_store_memory', 'resources', 'max_calls', or 'max_restarts', like '@ray.remote(num_returns=2, resources={"CustomResource": 1})'.

I checked the documentation Ray v2.0.0.dev0 and the correct parameters should be as follows:

@ray.remote(num_returns=3)
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant