coleygroup / molpal

active learning for accelerated high-throughput virtual screening
MIT License
163 stars 36 forks source link

[QUESTION]: Error with Import ray.train #55

Open aashuph16221 opened 1 month ago

aashuph16221 commented 1 month ago

Hello,

I am currently testing MolPAL and encountered an issue when running it with the following configuration:

[model] model = mpn conf-method = mve

Despite updating the trainer, I continue to receive the following error:

base) [aashish@pharmcluster3 fingerprint]$ tail -f slurm-3331.out explorer = Explorer(path, params) File "/shared/src/molpal/molpal/explorer.py", line 147, in init self.model = models.model(input_size=len(self.featurizer), kwargs) File "/shared/src/molpal/molpal/models/init.py", line 27, in model return mpn(**kwargs) File "/shared/src/molpal/molpal/models/init.py", line 55, in mpn from molpal.models.mpnmodels import MPNModel, MPNDropoutModel, MPNTwoOutputModel File "/shared/src/molpal/molpal/models/mpnmodels.py", line 16, in from ray.train import Trainer as RayTrainer ImportError: cannot import name 'Trainer' from 'ray.train' (/shared/apps/anaconda3/2024.02/envs/molpal/lib/python3.8/site-packages/ray/train/init.py)

It seems there may be an issue with the import from ray.train. Could you kindly advise if this is related to a version conflict, a missing dependency, or a potential bug? Any guidance on resolving this issue would be greatly appreciated.

Thank you for your time and support!

Regards,

Aashish

connorcoley commented 1 month ago

It looks like Ray has deprecated the Trainer class at some point in the last couple of years. (https://docs.ray.io/en/latest/train/train.html)

In our environment, we specify ray >= 1.11; I don't recall the precise version @davidegraff used, but perhaps you can try using a version of ray around 1.11 and see if this resolves the issue

aashuph16221 commented 1 month ago

We installed fresh molpal and it installed without giving any error. I am currently working with both molpal and pyscreener in the same environment, but I'm running into an issue with Ray's version compatibility.

molpal: Requires Ray version 1.11 pyscreener: Requires Ray version >= 2.0 After installing both packages in the same environment, I'm encountering the following error when attempting to use Ray:

AttributeError: module 'ray.dashboard.optional_utils' has no attribute 'ClassMethodRouteTable'

This appears to be caused by the version conflict between Ray dependencies. Additionally, I would like to ask if you have an environment YAML file that is compatible with mpnmodel to facilitate setting up a suitable environment. Could you please advise on how to resolve this conflict? Are there any plans to update molpal to support Ray 2.x, or would you recommend alternative approaches for managing these dependencies?