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

AssertionError when run 01-Ray-Tasks.ipynb #39

Closed
qingtian1771 opened this issue Feb 25, 2021 · 4 comments
Closed

AssertionError when run 01-Ray-Tasks.ipynb #39

qingtian1771 opened this issue Feb 25, 2021 · 4 comments
Assignees

Comments

@qingtian1771
Copy link

When I run first cell:

from task_lesson_util import make_dmaps, run_simulations, stop_simulations
from pi_calc import str_large_n

It appears following error:

---------------------------------------------------------------------------
AssertionError                            Traceback (most recent call last)
<ipython-input-1-9c851064aaf9> in <module>
----> 1 from task_lesson_util import make_dmaps, run_simulations, stop_simulations
      2 from pi_calc import str_large_n

~/code/ray/academy/ray-crash-course/task_lesson_util.py in <module>
     15 from bokeh.plotting import figure, output_file, show
     16 
---> 17 from pi_calc import MonteCarloPi, compute_pi_for
     18 
     19 

~/code/ray/academy/ray-crash-course/pi_calc.py in <module>
    104 
    105 @ray.remote
--> 106 class RayMonteCarloPi(MonteCarloPi):
    107     @ray.method(num_returns=5)
    108     def sample(self, num_samples):

~/code/ray/academy/ray-crash-course/pi_calc.py in RayMonteCarloPi()
    105 @ray.remote
    106 class RayMonteCarloPi(MonteCarloPi):
--> 107     @ray.method(num_returns=5)
    108     def sample(self, num_samples):
    109         return super().sample(num_samples)

~/anaconda3/envs/anyscale-academy/lib/python3.7/site-packages/ray/actor.py in method(*args, **kwargs)
     37     assert len(args) == 0
     38     assert len(kwargs) == 1
---> 39     assert "num_return_vals" in kwargs
     40     num_return_vals = kwargs["num_return_vals"]
     41 

AssertionError: 

What's the problem? Could you please help!

@grechaw
Copy link

grechaw commented Mar 10, 2021

I've experienced the same issue. I'll see if I can get to a root cause.

@grechaw
Copy link

grechaw commented Mar 10, 2021

Indeed, the keyword argument in line 107 does not match the assertion. When I change the ray academy code, the assertion succeeds - will prepare a PR that fixes this issue.

@grechaw grechaw self-assigned this Mar 10, 2021
@grechaw
Copy link

grechaw commented Mar 10, 2021

Actually, this keyword argument appears to have been updated for ray 1.2.0, so the assertion is indeed wrong for the version of ray provided in environment.yml. Fixing #38 will resolve this problem.

@ceteri ceteri self-assigned this Mar 11, 2021
@ceteri
Copy link
Collaborator

ceteri commented Mar 12, 2021

Should be fixed now.

@ceteri ceteri closed this as completed Mar 12, 2021
ceteri added a commit that referenced this issue Mar 12, 2021
ceteri added a commit that referenced this issue Mar 12, 2021
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

3 participants