Kohulan / DECIMER-Image_Transformer

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

DNN library is not found #85

Closed nbosc closed 9 months ago

nbosc commented 9 months ago

Issue Type

Compatibility issue

Source

PyPi

DECIMER Image Transformer Version

2.3.0

OS Platform and Distribution

Linux 4.18.0-348.el8.0.2.x86_64 x86_64

Python version

3.9.7

Current Behaviour?

DNN library is not found when using predict_SMILES

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

It's not an image-related error but here it is anyway. CID89150000

Standalone code to reproduce the issue

from DECIMER import predict_SMILES
image = 'CID89150000.png'
smiles = predict_SMILES(image)

Relevant log output

File "/nfs/image2structure/patent_image2structure_comparison_decimer_cluster_gpu.py", line 30, in image_to_smiles
    SMILES = predict_SMILES(image_file)
  File "/nfs/image2structure/decimer/lib/python3.9/site-packages/DECIMER/decimer.py", line 135, in predict_SMILES
    predicted_tokens, _ = DECIMER_V2(chemical_structure)
  File "/nfs/image2structure/decimer/lib/python3.9/site-packages/tensorflow/python/saved_model/load.py", line 740, in _call_attribute
    return instance.__call__(*args, **kwargs)
  File "/nfs/image2structure/decimer/lib/python3.9/site-packages/tensorflow/python/util/traceback_utils.py", line 153, in error_handler
    raise e.with_traceback(filtered_tb) from None
  File "/nfs/image2structure/decimer/lib/python3.9/site-packages/tensorflow/python/eager/execute.py", line 52, in quick_execute
    tensors = pywrap_tfe.TFE_Py_Execute(ctx._handle, device_name, op_name,
tensorflow.python.framework.errors_impl.UnimplementedError: Graph execution error:

Detected at node 'encoder/eff_net_v2_model/stem/conv2d/Conv2D' defined at (most recent call last):
Node: 'encoder/eff_net_v2_model/stem/conv2d/Conv2D'
DNN library is not found.
         [[{{node encoder/eff_net_v2_model/stem/conv2d/Conv2D}}]] [Op:__inference_restored_function_body_186354]

Code of Conduct

Kohulan commented 9 months ago

Dear @nbosc ,

For me, DECIMER 2.3.0 works on a ubuntu system. Tensorflow version: 2.12.0 (no GPU used) CUDA version:

Copyright (c) 2005-2021 NVIDIA Corporation
Built on Thu_Nov_18_09:45:30_PST_2021
Cuda compilation tools, release 11.5, V11.5.119
Build cuda_11.5.r11.5/compiler.30672275_0

Result for the image: COC(=O)C1=CN=C(C=C1)NC(=O)/C(=N/N2CCCC2)/C3=CC=C(C=C3)S(=O)(=O)C

Upon reviewing the error, it appears to potentially be related to a compatibility issue between CUDA and TensorFlow. Without more details, it's challenging to provide specific assistance. However, a possible solution could be to try using a TensorFlow version that is compatible with your CUDA version. Please consider exploring this avenue for resolution. If you can provide more information, I might be able to offer more targeted guidance.

nbosc commented 9 months ago

Dear @Kohulan , I also think it's a compatibility issue and I tried several combinations without success so far. Now I believe I have what is required by the different library.

Because of the DECIMER 2.3 requirements I have tensorflow 2.12.0

tensorboard-data-server      0.7.2
tensorflow                   2.12.0
tensorflow-estimator         2.12.0
tensorflow-io-gcs-filesystem 0.35.0

And because of tensorflow 2.12.0, I have cuda 11.8.0.

I have also been said to use cudnn and currently I an running cudnn-8.0.4.30.

Kohulan commented 9 months ago

Hi @nbosc ,

Thank you for the clarification. If GPU utilization is not part of your setup, then CUDA compatibility shouldn't be a concern. If you have further questions or encounter any other issues, please don't hesitate to reach out.

Maybe this is useful: https://www.tensorflow.org/install/source#gpu

nbosc commented 9 months ago

Actually I would like to use our GPUs to see how much it speeds up our workflow.

Do I need CUDNN?

Kohulan commented 9 months ago

If you want to use GPUs, I suggest installing TensorFlow as suggested by the TensorFlow community and using DECIMER. Also, CUDNN is needed.

nbosc commented 9 months ago

Okay I had CUDNN 8.7 installed and now it's using the GPU. Thanks