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

demos #26

Open
xiaorandu opened this issue May 4, 2024 · 1 comment
Open

demos #26

xiaorandu opened this issue May 4, 2024 · 1 comment

Comments

@xiaorandu
Copy link

Following up on my previous post, I tried to run all the demos, however, for each of them I failed at its last step, and received the pretty much the similar error.
`
TypeError Traceback (most recent call last)
in <cell line: 9>()
8
9 for epoch in range(1, args.epochs + 1):
---> 10 loss_acc = train_func(model, device, train_loader, optimizer)
11 print("Epoch: {}\nLoss: {}".format(epoch, loss_acc))
12

5 frames
/usr/local/lib/python3.10/dist-packages/torch/_utils.py in reraise(self)
720 # instantiate since we don't know how to
721 raise RuntimeError(msg) from None
--> 722 raise exception
723
724

TypeError: Caught TypeError in DataLoader worker process 0.
Original Traceback (most recent call last):
File "/usr/local/lib/python3.10/dist-packages/torch/utils/data/_utils/worker.py", line 308, in _worker_loop
data = fetcher.fetch(index)
File "/usr/local/lib/python3.10/dist-packages/torch/utils/data/_utils/fetch.py", line 51, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/usr/local/lib/python3.10/dist-packages/torch/utils/data/_utils/fetch.py", line 51, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/usr/local/lib/python3.10/dist-packages/torch_geometric/data/dataset.py", line 289, in getitem
data = self.get(self.indices()[idx])
File "/content/drive/MyDrive/MoleculeSTM/MoleculeSTM/datasets/MoleculeNet_Graph.py", line 184, in get
for key in self.data.keys:
TypeError: 'method' object is not iterable
`
Could you provide some insights on how to address this issue? Thank you!

@xiaorandu
Copy link
Author

btw, I run the demo code in google colab (Python 3.10), and here are the installed packages, not sure if it is the compatible issue.
`
!pip install rdkit
!pip install torch torchvision
!pip install requests tqdm matplotlib spacy Levenshtein boto3 deepspeed
!pip install ogb==1.2.0
!pip install transformers==4.30.2

!pip install torch_geometric
!pip install torch-scatter -f https://data.pyg.org/whl/torch-2.2.1+cu121.html
!pip install torch-sparse -f https://data.pyg.org/whl/torch-2.2.1+cu121.html
!pip install torch-cluster -f https://data.pyg.org/whl/torch-2.2.1+cu121.html
!pip install torch-spline-conv -f https://data.pyg.org/whl/torch-2.2.1+cu121.html
!pip install git+https://github.com/MolecularAI/pysmilesutils.git

!git clone https://github.com/chao1224/apex.git
%cd apex
!pip install -v --disable-pip-version-check --no-cache-dir ./
%cd ..
`

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

1 participant