rxn4chemistry / rxnmapper

RXNMapper: Unsupervised attention-guided atom-mapping. Code complementing our Science Advances publication on "Extraction of organic chemistry grammar from unsupervised learning of chemical reactions" (https://advances.sciencemag.org/content/7/15/eabe4166).
http://rxnmapper.ai
MIT License
286 stars 68 forks source link

AttributeError: 'SmilesTokenizer' object has no attribute 'max_l #13

Closed longthanhta closed 3 years ago

longthanhta commented 3 years ago

Hi,

I got this problem when trying to run the example

Traceback (most recent call last):
  File "atom_mapping.py", line 2, in <module>
    rxn_mapper = RXNMapper()
  File "C:\Users\tangu\anaconda3\lib\site-packages\rxnmapper\core.py", line 65, in __init__
    self.model, self.tokenizer = self._load_model_and_tokenizer()
  File "C:\Users\tangu\anaconda3\lib\site-packages\rxnmapper\core.py", line 91, in _load_model_and_tokenizer
    tokenizer = SmilesTokenizer(
  File "C:\Users\tangu\anaconda3\lib\site-packages\rxnmapper\tokenization_smiles.py", line 45, in __init__
    self.max_len_single_sentence = self.max_len - 2
AttributeError: 'SmilesTokenizer' object has no attribute 'max_len

Please help to solve it,

Thank you!

longthanhta commented 3 years ago

I got this problem when using version from pip I updated github version, the problem solved now.

YH-88 commented 3 years ago

Hello, I'm having the same problem. Did you install it through GitHub or PIP?I have the following problems when installing on GitHub. Could you please tell me the specific installation process? image

longthanhta commented 3 years ago

You should install rdkit https://www.rdkit.org/docs/Install.html

YH-88 commented 3 years ago

Thanks a lot. But how do you specify a specific version?I'm running on Windows now, does that matter?Also, did you clone the code directly and then run the rest of the code directly in Windows PowerShell.