ZikangZhou / HiVT

[CVPR 2022] HiVT: Hierarchical Vector Transformer for Multi-Agent Motion Prediction
https://openaccess.thecvf.com/content/CVPR2022/papers/Zhou_HiVT_Hierarchical_Vector_Transformer_for_Multi-Agent_Motion_Prediction_CVPR_2022_paper.pdf
Apache License 2.0
577 stars 115 forks source link

Installation Error #21

Closed wuhaoran111 closed 1 year ago

wuhaoran111 commented 1 year ago

After i follow the instructions of this repo:

conda create -n HiVT python=3.8
conda activate HiVT
conda install pytorch==1.8.0 cudatoolkit=11.1 -c pytorch -c conda-forge
conda install pytorch-geometric==1.7.2 -c rusty1s -c conda-forge
conda install pytorch-lightning==1.5.2 -c conda-forge

and then i run:

python eval.py --root ../datasets/ --batch_size 32 --ckpt_path checkpoints/HiVT-64/checkpoints/epoch\=63-step\=411903.ckpt

it always show that:

Original Traceback (most recent call last):
  File "/home/cunjun/miniconda3/envs/HiVT/lib/python3.8/site-packages/torch/utils/data/_utils/worker.py", line 302, in _worker_loop
    data = fetcher.fetch(index)
  File "/home/cunjun/miniconda3/envs/HiVT/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 49, in fetch
    data = [self.dataset[idx] for idx in possibly_batched_index]
  File "/home/cunjun/miniconda3/envs/HiVT/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 49, in <listcomp>
    data = [self.dataset[idx] for idx in possibly_batched_index]
  File "/home/cunjun/miniconda3/envs/HiVT/lib/python3.8/site-packages/torch_geometric/data/dataset.py", line 193, in __getitem__
    data = self.get(self.indices()[idx])
  File "/home/cunjun/wuhr/HiVT/datasets/argoverse_v1_dataset.py", line 87, in get
    return torch.load(self.processed_paths[idx])
  File "/home/cunjun/miniconda3/envs/HiVT/lib/python3.8/site-packages/torch/serialization.py", line 712, in load
    return _load(opened_zipfile, map_location, pickle_module, **pickle_load_args)
  File "/home/cunjun/miniconda3/envs/HiVT/lib/python3.8/site-packages/torch/serialization.py", line 1049, in _load
    result = unpickler.load()
  File "/home/cunjun/miniconda3/envs/HiVT/lib/python3.8/site-packages/torch/serialization.py", line 1042, in find_class
    return super().find_class(mod_name, name)
AttributeError: Can't get attribute 'DataEdgeAttr' on <module 'torch_geometric.data.data' from '/home/cunjun/miniconda3/envs/HiVT/lib/python3.8/site-packages/torch_geometric/data/data.py'>

I'm stucked here for several times. And i don't know how to solve it. Hope to get your help.

seashine33 commented 1 year ago

You can try the following command: pip uninstall torch_geometric pip install torch_geometric

SevenTailCat commented 1 year ago

You may installed torch_geometric with wrong edition before. Please reintall the torch_geometric and remove the processed file in dataset. It works for me. The reason is that it processed the data with unsuitable form at the first time you run the program. And when you run this program again, the Dataloader will check if there is file named 'processed' exist. If it is there, it will not run the data processing code and directly read the processed data files. But torch_geometric with diffirent edictions process diffirent data forms and it cause the problem.

wuhaoran111 commented 1 year ago

The reason is that it processed the data with unsuitable form at the first time you run the program. And when you run this program again, the Dataloader will check if there is file named 'processed' exist. If it is there, it will not run the data processing code and directly read the processed data files. But torch_geometric with diffirent edictions process diffirent data forms and it cause the problem.

Yes, that's it. Thank you.