Skip to content

Instantly share code, notes, and snippets.

@deanwampler
Created January 28, 2020 00:16
Show Gist options
  • Save deanwampler/e884f2aaa924fb612bb1e82993d88305 to your computer and use it in GitHub Desktop.
Save deanwampler/e884f2aaa924fb612bb1e82993d88305 to your computer and use it in GitHub Desktop.
iteration: 1
Ready length, values: 2 [5, 10]
Not Ready length: 3
iteration: 2
Ready length, values: 2 [15, 20]
Not Ready length: 1
---------------------------------------------------------------------------
Exception Traceback (most recent call last)
<ipython-input-7-a3a41a1b0002> in <module>
1 ids = [busy.remote(i) for i in times] # New set of ids
2 for i in range(1,40):
----> 3 ready, not_ready = ray.wait(ids, num_returns = 2)
4 print('iteration:', i)
5 print('Ready length, values: ', len(ready), ray.get(ready))
~/anaconda3/envs/ray/lib/python3.7/site-packages/ray/worker.py in wait(object_ids, num_returns, timeout)
2262 "Invalid number of objects to return %d." % num_returns)
2263 if num_returns > len(object_ids):
-> 2264 raise Exception("num_returns cannot be greater than the number "
2265 "of objects provided to ray.wait.")
2266
Exception: num_returns cannot be greater than the number of objects provided to ray.wait.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment