Kohulan / Smiles-TO-iUpac-Translator

Transformer based SMILES to IUPAC Translator
MIT License
137 stars 27 forks source link

No module named 'keras.preprocessing.text' #33

Closed syr-cn closed 1 month ago

syr-cn commented 1 month ago

Thanks for you great work. When running the demo script in the README.md, I get the following error:

Traceback (most recent call last):
  File "/[my_path]/stout_demo.py", line 8, in <module>
    IUPAC_name = translate_forward(SMILES)
  File "/root/miniconda3/envs/stout/lib/python3.10/site-packages/STOUT/stout.py", line 62, in translate_forward
    inp_lang = pickle.load(
ModuleNotFoundError: No module named 'keras.preprocessing.text'

I try to load the STOUT-V2/models/assets/tokenizer_input.pkl file manually: pickle.load(open('tokenizer_input.pkl', 'rb')) I get:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'keras.preprocessing.text'

Is there any problem with the pkl file? How can I solve this problem?

syr-cn commented 1 month ago

Build from source solved my problem. Sorry for the bothering