microsoft / syntheseus

Package for Retrosynthetic Planning
https://microsoft.github.io/syntheseus/
MIT License
111 stars 14 forks source link

Some Code Package Missing 【Help wanted】 #55

Closed zw-SIMM closed 8 months ago

zw-SIMM commented 8 months ago

When running the scripts

from syntheseus.reaction_prediction.inference import *

models = [
    LocalRetroModel(),
]

Meet errors

ImportError: cannot import name 'scripts' from 'local_retro' (/home/zw/syntheseus/syntheseus/reaction_prediction/inference/local_retro.py)

When running the scripts

from syntheseus.reaction_prediction.inference import *

models = [
    RootAlignedModel(),
]

Meet errors

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)

ImportError: cannot import name 'score' from 'root_aligned' (/home/zw/syntheseus/syntheseus/reaction_prediction/inference/root_aligned.py)
AustinT commented 8 months ago

Hello @zw-SIMM, thanks for your interest in syntheseus.

I tried to reproduce your issue by creating a fresh conda environment, cloning syntheseus, running pip install ".[all]", then running the lines of code in your issue. They ran without generating any error for me.

Without any more information on your setup I don't think I can help. Try re-installing your python environment? If it still does not work, please provide instructions to create a python environment where this error is reproduced and we can try to help.

zw-SIMM commented 8 months ago

Hello @zw-SIMM, thanks for your interest in syntheseus.

I tried to reproduce your issue by creating a fresh conda environment, cloning syntheseus, running , then running the lines of code in your issue. They ran without generating any error for me.pip install ".[all]"

Without any more information on your setup I don't think I can help. Try re-installing your python environment? If it still does not work, please provide instructions to create a python environment where this error is reproduced and we can try to help.

Thanks a lot for your reply! Very useful and practical work! I re-installed my python environment and it worked. ✌

mamba env create -f environment.yml
mamba activate syntheseus
pip install -e ".[local-retro,root-aligned]"

Another question, when I tried to run,

pip install ".[all]"

met errors (maybe due to my 12.3 cuda version?)

/home/zw/miniforge-pypy3/envs/syntheseus-full/lib/python3.9/site-packages/torch/include/ATen/core/builtin_function.h(117): warning #20236-D: pragma "diag_default" is deprecated, use "nv_diag_default" instead

      /usr/include/c++/11/bits/std_function.h:435:145: error: parameter packs not expanded with ‘...’:
        435 |         function(_Functor&& __f)
            |                                                                                                                                                 ^
      /usr/include/c++/11/bits/std_function.h:435:145: note:         ‘_ArgTypes’
      /usr/include/c++/11/bits/std_function.h:530:146: error: parameter packs not expanded with ‘...’:
        530 |         operator=(_Functor&& __f)
            |                                                                                                                                                  ^
      /usr/include/c++/11/bits/std_function.h:530:146: note:         ‘_ArgTypes’
      error: command '/usr/bin/nvcc' failed with exit code 1
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for torch-scatter
  Running setup.py clean for torch-scatter
Successfully built syntheseus
Failed to build torch-scatter
ERROR: Could not build wheels for torch-scatter, which is required to install pyproject.toml-based projects
AustinT commented 8 months ago

Glad to hear that this worked for you! I will close this issue.

Another question, when I tried to run,

pip install ".[all]"

met errors (maybe due to my 12.3 cuda version?)

/home/zw/miniforge-pypy3/envs/syntheseus-full/lib/python3.9/site-packages/torch/include/ATen/core/builtin_function.h(117): warning #20236-D: pragma "diag_default" is deprecated, use "nv_diag_default" instead

      /usr/include/c++/11/bits/std_function.h:435:145: error: parameter packs not expanded with ‘...’:
        435 |         function(_Functor&& __f)
            |                                                                                                                                                 ^
      /usr/include/c++/11/bits/std_function.h:435:145: note:         ‘_ArgTypes’
      /usr/include/c++/11/bits/std_function.h:530:146: error: parameter packs not expanded with ‘...’:
        530 |         operator=(_Functor&& __f)
            |                                                                                                                                                  ^
      /usr/include/c++/11/bits/std_function.h:530:146: note:         ‘_ArgTypes’
      error: command '/usr/bin/nvcc' failed with exit code 1
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for torch-scatter
  Running setup.py clean for torch-scatter
Successfully built syntheseus
Failed to build torch-scatter
ERROR: Could not build wheels for torch-scatter, which is required to install pyproject.toml-based projects

This looks like an issue with CUDA or g++. I found a similar issue on stackoverflow, although it is for a different CUDA version. This is not an issue with syntheseus though (the error seems to come from the installation of torch-scatter), so we are not the right people to help you with it. Hope you are able to resolve it!