Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TF backend support #126

Closed
popfido opened this issue Jan 5, 2021 · 9 comments
Closed

TF backend support #126

popfido opened this issue Jan 5, 2021 · 9 comments

Comments

@popfido
Copy link

popfido commented Jan 5, 2021

I'm using tensorflow as dgl backend in my local macbook since apple release its Metal-accelerated version of tensorflow. But it seems that the dgl-lifesci does not support tensorflow backend when I import dgllife.

In [1]: import dgllife
Using backend: tensorflow
2021-01-05 11:13:59.073796: I tensorflow/core/platform/cpu_feature_guard.cc:142] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations:  AVX2 FMA
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-1-68d2941e7384> in <module>
----> 1 import dgllife

~/anaconda3/envs/main/lib/python3.8/site-packages/dgllife/__init__.py in <module>
      7
      8 from .libinfo import __version__
----> 9 from . import model
     10
     11 try:

~/anaconda3/envs/main/lib/python3.8/site-packages/dgllife/model/__init__.py in <module>
      4 # SPDX-License-Identifier: Apache-2.0
      5
----> 6 from .gnn import *
      7 from .readout import *
      8 from .model_zoo import *

~/anaconda3/envs/main/lib/python3.8/site-packages/dgllife/model/gnn/__init__.py in <module>
      6 # Graph neural networks for updating node representations
      7
----> 8 from .attentivefp import *
      9 from .gat import *
     10 from .gcn import *

~/anaconda3/envs/main/lib/python3.8/site-packages/dgllife/model/gnn/attentivefp.py in <module>
     12 import torch.nn.functional as F
     13
---> 14 from dgl.nn.pytorch import edge_softmax
     15
     16 __all__ = ['AttentiveFPGNN']

ModuleNotFoundError: No module named 'dgl.nn.pytorch'

So dgllife currently only support pytorch as backend engine and did not intend to be prepared in 0.3 roadmap?

@popfido popfido changed the title backend support TF backend support Jan 5, 2021
@mufeili
Copy link
Contributor

mufeili commented Jan 5, 2021

Yes. Due to limited bandwidth, we do not plan to support TF.

@mufeili mufeili closed this as completed Jan 7, 2021
@danielmanu93
Copy link

danielmanu93 commented Jun 5, 2021

I am having a similar problem. I'm using pytorch backend to import dgllife but I get this error "ModuleNotFoundError: No module named 'dgl.nn.functional'". How can I fix this.

1

@mufeili
Copy link
Contributor

mufeili commented Jun 6, 2021

I am having a similar problem. I'm using pytorch backend to import dgllife but I get this error "ModuleNotFoundError: No module named 'dgl.nn.functional'". How can I fix this.

1

You need to update DGL to 0.6.x.

@danielmanu93
Copy link

danielmanu93 commented Jun 6, 2021

After I updated DGL to 0.6.1 using conda, the error has changed to "ImportError: cannot import name 'smiles_to_graph' from 'dgllife.utils' " as shown below.
1

Below is the code I'm tryna execute:
1

@mufeili
Copy link
Contributor

mufeili commented Jun 6, 2021

After I updated DGL to 0.6.1 using conda, the error has changed to "ImportError: cannot import name 'smiles_to_graph' from 'dgllife.utils' " as shown below.
1

Below is the code I'm tryna execute:
1

You need to change smiles_to_graph to smiles_to_bigraph.

@danielmanu93
Copy link

Thank you! It worked

@danielmanu93
Copy link

danielmanu93 commented Jun 7, 2021

How do I access only the number of edges in the graph? I used g[1] but I get an error.
Below is how it appear when I print the graph (g). The second attribute is the number of edges.

1

@mufeili
Copy link
Contributor

mufeili commented Jun 7, 2021

How do I access only the number of edges in the graph? I used g[1] but I get an error.
Below is how it appear when I print the graph (g). The second attribute is the number of edges.

1

You can use g.num_edges(). See also the API reference for DGL.

@mufeili
Copy link
Contributor

mufeili commented Jun 14, 2021

Hi I'm having this issue with SMILES parse error. I'm trying to generate molecules from smiles with the attached generate function but I get the "SMILES parse error" in the terminal when I call the function. How can I fix this issue?

1
2

These appear to be issues related to RDKit so you should open an issue there. If you have further issues, please open a new thread as they are irrelevant to this thread.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants