I am trying to use ray client to a remote cluster. With the basic example below, it works through printing the results, but upon exit, it crashes with:
AttributeError: ‘NoneType’ object has no attribute ‘ray’
Exception ignored in: ‘ray._raylet.ClientObjectRef.dealloc’
AttributeError: ‘NoneType’ object has no attribute ‘ray’
Error in sys.excepthook:
Original exception was:
Error in sys.excepthook:
Original exception was:
Can anybody suggest a fix or workaround?
#!/usr/bin/env python3
--python--
import ray
import time
import os
import sys
rayInst = ray.init(‘ray://20.35.200.38:10001’)
@ray.remote
def f(x):
time.sleep(1)
return f’{x}->{os.uname()[1]}’
result_ids =
for i in range(4):
result_ids.append(f.remote(i))
results = ray.get(result_ids) # [0, 1, 2, 3]
print(’\n’.join(results))