MolecularAI / aizynthtrain

Tools to train synthesis prediction models
Apache License 2.0
21 stars 7 forks source link

Help with aizynthtrain #8

Closed SBC-ICOA closed 7 months ago

SBC-ICOA commented 10 months ago

Hi,

I'd like to train a model from new data and first I try to follow your documentation and try to reproduce math is done with uspto data. I succeeded in creating different environments : aizhynthfinder-env rnx-env rxnmapper I'm able to run the two pipelines preparation_pipeline (from rxn-env) and mapping_pipeline (from rnxmapper) and to obtain the two files : uspto_data_cleaned.csv and uspto_data_mapped.csv But I have some troubles with aizynthtrain. By activativing rxn-env I'm able to access to the right python from the rnx-env environment and to the mapping_pipeline.py that is in a different folder (the one from the clone of the git repo). When I activate aizynthtrain environment the python used is well the one from the environment but I'm faced to that error : path_to_aizynthtrain/bin/python: Error while finding module specification for 'aizynthtrain.pipelines.template_pipeline' (ModuleNotFoundError: No module named 'aizynthtrain'). Python is unable to access to the code from the git clone of aizynthtrain. I'd like to add that I'm trying to run the commands below extracted from the template_pipeline.sh to test on my machine before to try it on a cluster : conda activate path_to_aizynthtrain/aizynthtrain python -m aizynthtrain.pipelines.template_pipeline run --config template_pipeline_config.yml --max-workers 8 --max-num-splits 200

I have just encountered a problem during the setting of aizynthtrain environment : Installing sklearn (0.0.post1): Failed But scikit-learn is present in the environment and I was able to test it positively.

Any help would be really appreciated. Thanks

SGenheden commented 10 months ago

Hello It looks like aizynthtrain was never installed in the aizynthtrain environment. Can you double check by

  1. Goto the folder of the aizynthtrain Git repo
  2. Activate the conda environment
  3. Execute poetry install if you had some issue with the poetry execution, it might be that it never completed the installation of aizynthtrain.
SBC-ICOA commented 10 months ago

Hello.

Thanks for the answer. You probably find what's wrong. When I list (conda list) the packages installed in the aizynthtrain environment I can't find aizynthtrain, but aizynthfinder is installed (version) 3.4.0. I have a problem following the poetry install command, a problem regarding sklearn. I rerun poetry install and obtain this time only the error message : Installing dependencies from lock file

Package operations: 1 install, 0 updates, 0 removals

• Installing sklearn (0.0.post1): Failed

ChefBuildError

Backend subprocess exited when trying to invoke get_requires_for_build_wheel

The 'sklearn' PyPI package is deprecated, use 'scikit-learn' rather than 'sklearn' for pip commands.

Here is how to fix this error in the main use cases:

Note: This error originates from the build backend, and is likely not a problem with poetry but with sklearn (0.0.post1) not supporting PEP 517 builds. You can verify this by running 'pip wheel --no-cache-dir --use-pep517 "sklearn (==0.0.post1)"'.

I'm surprised because scikit-learn (1.2.2 from pypi) is installed and I have tested the library which is ok.

I'm not familiar with poetry. So It seems the installation process is not completed.

What should I do to correct the sklearn error and continue the installation ?

SGenheden commented 10 months ago

The dependencies are a bit old. I have pushed a branch where I have updated the dependencies. Please try this

git checkout update-dependencies
poetry install

if poetry still complaints. Try to remove the conda environment, create it again and then install with poetry.

JeremyMolineau commented 7 months ago

Thank you for your responses. We have tested it with @SBC-ICOA Problems have been fixed with updated dependencies.