KevinHoarau / BGNN

MIT License
5 stars 1 forks source link

Error when processing data #1

Open Edelweissghr opened 1 year ago

Edelweissghr commented 1 year ago

Thanks for your contribution, it is very helpful to my research. I used the same parameters to execute collect_transform.py and transform_to_pyg.py in sequence and got a data_pyg1.pickle. After inputting data_pyg1.pickle into eval.py, I reported an error:

(evolveGCN-GPU) aaa@SZ8226-AI1:~/bbb/bgp/BGNN$ python eval.py
BGNN model evaluation
   0%| | 0/1050 [00:00<?, ?it/s]Traceback (most recent call last):
   File "/home/aaa/bbb/bgp/BGNN/eval.py", line 122, in <module>
     model = train(trainEv, seed, nb_epoch, 0.001, layer)
   File "/home/aaa/bbb/bgp/BGNN/eval.py", line 39, in train
     pred = model(graphs, node)
   File "/home/aaa/miniconda3/envs/evolveGCN-GPU/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1194, in _call_impl
     return forward_call(*input, **kwargs)
   File "/home/aaa/bbb/bgp/BGNN/model.py", line 33, in forward
     indices.append(start + g.ASN.index(node))
ValueError: '200759' is not in list
   0%| | 0/1050 [00:28<?, ?it/s]

But if I directly use your data_pyg.pickle and load eval.py, there will be no problem. I have been researching this for several days and still have no solution. Looking forward to your answer.

KevinHoarau commented 1 year ago

Glad my work is useful to you !

Did everything go fine when you ran collect_transform.py ? You should obtain a data folder with a structure like this :

ls -lRh data/
data/:
total 16K
drwxrwxr-x 9 esiroi esiroi 4.0K Sep  8 15:37 anomaly
drwxrwxr-x 2 esiroi esiroi 4.0K Sep  8 15:37 collect_jobs
drwxrwxr-x 9 esiroi esiroi 4.0K Sep  8 15:37 no_anomaly
drwxrwxr-x 3 esiroi esiroi 4.0K Sep  8 16:13 transform_jobs

data/anomaly:
total 28K
drwxrwxr-x 6 esiroi esiroi 4.0K Sep  8 16:00 AWS
drwxrwxr-x 5 esiroi esiroi 4.0K Sep  8 16:02 ChinaTelecom
drwxrwxr-x 5 esiroi esiroi 4.0K Sep  8 15:59 Google
drwxrwxr-x 5 esiroi esiroi 4.0K Sep  8 15:56 India
drwxrwxr-x 5 esiroi esiroi 4.0K Sep  8 16:04 IndoSat
drwxrwxr-x 5 esiroi esiroi 4.0K Sep  8 16:00 TM
drwxrwxr-x 5 esiroi esiroi 4.0K Sep  8 16:02 TTNet

data/anomaly/AWS:
total 16K
drwxrwxr-x 2 esiroi esiroi 4.0K Sep  8 16:17 data
-rw-rw-r-- 1 esiroi esiroi  335 Sep  8 16:17 log_collect_sample.log
drwxrwxr-x 2 esiroi esiroi 4.0K Sep  8 16:17 priming_data
drwxrwxr-x 4 esiroi esiroi 4.0K Sep  8 16:14 transform

data/anomaly/AWS/data:
total 29M
-rw-rw-r-- 1 esiroi esiroi 29M Sep  8 15:50 updates.csv.gz
-rw-rw-r-- 1 esiroi esiroi 769 Sep  8 15:49 updates_dump.log

data/anomaly/AWS/priming_data:
total 16M
-rw-rw-r-- 1 esiroi esiroi 16M Sep  8 15:47 routes.json.gz
-rw-rw-r-- 1 esiroi esiroi 743 Sep  8 15:47 routes_snapshot.log
-rw-rw-r-- 1 esiroi esiroi 778 Sep  8 15:46 updates_dump.log

data/anomaly/AWS/transform:
total 8.0K
drwxrwxr-x 2 esiroi esiroi 4.0K Sep  8 16:01 Graph

data/anomaly/AWS/transform/Graph:
total 121M
-rw-rw-r-- 1 esiroi esiroi  946 Sep  8 16:01 transform.log
-rw-rw-r-- 1 esiroi esiroi 121M Sep  8 16:01 WeightedGraph_2.pickle

...