Hello. I’m trying to add a custom training backend, similar to how Ray integrates PyTorch. The issue is, when I define a network model (which is different from PyTorch’s nn.Module), is train_loop_per_worker(), it has the following error message:
File “python/ray/_raylet.pyx”, line 655, in ray._raylet.execute_task
File “python/ray/_raylet.pyx”, line 696, in ray._raylet.execute_task
File “python/ray/_raylet.pyx”, line 662, in ray._raylet.execute_task
File “python/ray/_raylet.pyx”, line 666, in ray._raylet.execute_task
File “python/ray/_raylet.pyx”, line 613, in ray._raylet.execute_task.function_executor
File “/home/wjeon/ray/python/ray/_private/function_manager.py”, line 674, in actor_method_executor
return method(__ray_actor, *args, **kwargs)
File “/home/wjeon/ray/python/ray/_private/function_manager.py”, line 586, in temporary_actor_method
raise RuntimeError(
RuntimeError: The actor with name TrainTrainable failed to import on the worker. This may be because needed library dependencies are not installed in the worker environment:
Traceback (most recent call last):
File “/home/wjeon/ray/python/ray/_private/function_manager.py”, line 625, in _load_actor_class_from_gcs
actor_class = pickle.loads(pickled_class)
File “/home/wjeon/ray/python/ray/cloudpickle/cloudpickle.py”, line 872, in _make_skeleton_class
skeleton_class = types.new_class(
File “/usr/lib/python3.8/types.py”, line 72, in new_class
meta, ns, kwds = prepare_class(name, resolved_bases, kwds)
File “/usr/lib/python3.8/types.py”, line 125, in prepare_class
meta = _calculate_meta(meta, bases)
File “/usr/lib/python3.8/types.py”, line 143, in _calculate_meta
raise TypeError("metaclass conflict: "
TypeError: metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases
Could you guide me how to tackle this issue? If my custom object for the network is implemented in C++ and provided to Python via pybind11, do I need to take care of native libraries accordingly, other than just importing the module of the corresponding Python objects?
Thanks.