maxpumperla / learning_ray

Notebooks for the O'Reilly book "Learning Ray"
https://maxpumperla.com/learning_ray
MIT License
257 stars 63 forks source link

Exception Errors in Chapter 4: Could be newbie error as well #3

Closed RustyKettle closed 1 year ago

RustyKettle commented 2 years ago

I'm going through this book and running the code as I go. I am running into the following issue:

ALL DONE Exception ignored in: <function RolloutWorker.__del__ at 0x7fb2260368c0> Traceback (most recent call last): File "/home/rustykettle/.local/lib/python3.10/site-packages/ray/util/tracing/tracing_helper.py", line 461, in _resume_span TypeError: 'NoneType' object is not callable

The ALL DONE is my print:

ray.init()
gymEnv = GymEnvironment()
trainer = DQNTrainer(env=GymEnvironment, config={"num_workers": 4})  # <1>
config = trainer.get_config()  # <2>
#print(pretty_print(config))

for i in range(10):
    result = trainer.train()  # <3>

ray.shutdown()
print(pretty_print(result))  # <4>
print("ALL DONE")

It is to show that the exception is something to do with Ray, but it also might have something to do with my configuration. I followed the book very closely, but I'm not discounting a user-error on my part. output.log

I'm also getting depreciation warnings that don't appear in the log. I'm imagining that this happens because it is happening on a different thread.

RustyKettle commented 2 years ago

Another quick observation. This doesn't happen when running via the cmd_line using the yml method, so it further points to something acting up in my script.

RustyKettle commented 2 years ago

More observations. It still happens with the multiagent example, and when updating to Ray 2,0.

maxpumperla commented 1 year ago

hey @RustyKettle, by now we've rewritten a substantial part of this chapter due to lots of API changes. I ran the examples locally and on colab and so far don't see any problems. Closing this issue for now, but please feel free to reopen if your problems persist!