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

Trying to create a DynamicGraphTemporalSignal for own dataset #285

Open
malihaqqani opened this issue Nov 14, 2024 · 0 comments
Open

Trying to create a DynamicGraphTemporalSignal for own dataset #285

malihaqqani opened this issue Nov 14, 2024 · 0 comments

Comments

@malihaqqani
Copy link

import torch
from torch_geometric_temporal.signal import DynamicGraphTemporalSignal

Load your snapshots

snapshots = []
for year in range(2000, 2004):
snapshot = torch.load(f'yearly_graphs/graph_{year}.pt')
snapshots.append(snapshot)

Extract features and edge index from snapshots

features = [snapshot.x for snapshot in snapshots]
edge_indices = [snapshot.edge_index for snapshot in snapshots]

Create the temporal signal object without targets

dataset = DynamicGraphTemporalSignal(edge_indices=edge_indices, features=features)---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
Cell In[1], line 2
1 import torch
----> 2 from torch_geometric_temporal.signal import DynamicGraphTemporalSignal
4 # Load your snapshots
5 snapshots = []

File ~/.conda/envs/new/lib/python3.10/site-packages/torch_geometric_temporal/init.py:1
----> 1 from torch_geometric_temporal.nn import *
2 from torch_geometric_temporal.dataset import *
3 from torch_geometric_temporal.signal import *

File ~/.conda/envs/new/lib/python3.10/site-packages/torch_geometric_temporal/nn/init.py:2
1 from .recurrent import *
----> 2 from .attention import *
3 from .hetero import *

File ~/.conda/envs/new/lib/python3.10/site-packages/torch_geometric_temporal/nn/attention/init.py:6
4 from .gman import GMAN, SpatioTemporalEmbedding, SpatioTemporalAttention
5 from .mtgnn import MTGNN, MixProp, GraphConstructor
----> 6 from .tsagcn import GraphAAGCN, AAGCN
7 from .dnntsp import DNNTSP

File ~/.conda/envs/new/lib/python3.10/site-packages/torch_geometric_temporal/nn/attention/tsagcn.py:6
4 import torch.nn as nn
5 from torch.autograd import Variable
----> 6 from torch_geometric.utils.to_dense_adj import to_dense_adj
7 import torch.nn.functional as F
10 class GraphAAGCN:

ModuleNotFoundError: No module named 'torch_geometric.utils.to_dense_adj'. The PyTorch version is 2.4.0 , the PyTorch geometric version is 2..6.1 and the torch geometric temporal is the latest version , python version is 3.10

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