@genv.ray.remote does not work on classes but only on methods.
When it is used before the functions, it works:
@genv.ray.remote(num_gpus=1)
def train():
But when it is used with classes;
@genv.ray.remote(num_gpus=1)
class Trainer:
def train(self):
it throws the following error:
2023-07-21 08:44:38,183 INFO worker.py:1636 -- Started a local Ray instance.
Traceback (most recent call last):
File "/home/ekinkarabulut/genv/ray_genv.py", line 105, in <module>
main_task = trainer.train.remote()
^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'ray._raylet.ObjectRef' object has no attribute 'train'
@genv.ray.remote
does not work on classes but only on methods.When it is used before the functions, it works:
But when it is used with classes;
it throws the following error: