Kohulan / DECIMER-Image_Transformer

DECIMER: Deep Learning for Chemical Image Recognition using Efficient-Net V2 + Transformer
MIT License
197 stars 51 forks source link

does decimer support run on window platform? #91

Closed yangxiaofei77 closed 7 months ago

yangxiaofei77 commented 7 months ago

Issue Type

Questions

Source

GitHub (source)

DECIMER Image Transformer Version

2.2

OS Platform and Distribution

window

Python version

3.9

Current Behaviour?

hello, there, could you help answer or give clue following error during the execution of decimer on window platform? Very Thanks!

I launch decimer project on window platform, with following envs installed :

tensorflow 2.16.1 tensorflow-intel 2.16.1 tensorflow-io-gcs-filesystem 0.31.0 keras 3.0.0 Keras-Applications 1.0.8 Keras-Preprocessing 1.1.2

however, when try to run the test, throw following error:

File "E:\aidata\ocr\DECIMER1\DECIMER\decimer.py", line 76, in tokenizer, DECIMER_V2, DECIMER_Hand_drawn = get_models(model_urls) File "E:\aidata\ocr\DECIMER1\DECIMER\decimer.py", line 67, in get_models tokenizer = pickle.load(open(tokenizer_path, "rb")) ModuleNotFoundError: No module named 'keras.preprocessing.text'.

could you help which tf version or keras version could resolve this error on window platform?

Regards,

Philip Yang

Which images caused the issue? (This is mandatory for images related issues)

No response

Standalone code to reproduce the issue

from DECIMER import predict_SMILES

def process_image_and_predict_smiles(image_path):
    try:
        SMILES = predict_SMILES(image_path)
        return SMILES
    except Exception as e:
        return f"Error processing image: {e}"

if __name__ == "__main__":
    # 输入文件路径和输出文件路径

    input_image = "E:\\doc\\ai\\daily\\20240307\\4.png"

    # 处理文本文件
    smiles = process_image_and_predict_smiles(input_image)
    print(smiles)

Relevant log output

No response

Code of Conduct

yangxiaofei77 commented 7 months ago

solved this issue by downgrade tensorflow version to 2.10.1, close this issue.