awslabs / dgl-lifesci

Python package for graph neural networks in chemistry and biology
Apache License 2.0
730 stars 151 forks source link

TypeError: 'method' object is not subscriptable - (pretrained_model ) #98

Closed atharvapurdue closed 4 years ago

atharvapurdue commented 4 years ago

image In the pretrained model - reaction_prediction_pretrained.ipynb Command -wget https://data.dgl.ai/dgllife/reaction_prediction_pretrained.ipynb I am getting the above error. python 3.8 The notebook is in proper directory. In fact, i have run it previously and did not face this issue. facing this issue after creating a new environment to train a model on my own dataset please help

mufeili commented 4 years ago

Sorry for the inconvenience.

As of DGL 0.5, batch_num_nodes and batch_num_edges are now functions returning tensors rather than properties returning lists as in <DGL0.5. For example, you need to replace .batch_num_edges[i] by .batch_num_edges()[i].item(). I should have fixed these issues in the latest repo and you can do a git pull.

atharvapurdue commented 4 years ago

image

.item() worked! This is another bug I dont think the repo contains the pre-trained model - I did a wget https://data.dgl.ai/dgllife/reaction_prediction_pretrained.ipynb Edit - new error image

mufeili commented 4 years ago

image

.item() worked! This is another bug I dont think the repo contains the pre-trained model - I did a wget https://data.dgl.ai/dgllife/reaction_prediction_pretrained.ipynb Edit - new error image

Apology for that. The error is due to the change of WLNRankDataset, not the pre-trained models. I've updated the jupyter notebook host on S3. Can you try re-downloading it?

atharvapurdue commented 4 years ago

Problem solved ! Thank you!