Cogito2012 / UString

[ACM MM 2020] Uncertainty-based Traffic Accident Anticipation
MIT License
63 stars 18 forks source link

demo #22

Closed wangzhipeng2020 closed 1 year ago

wangzhipeng2020 commented 2 years ago

I I set up the environment according to your requirements and have generated 000821_feature. npz file, but I still can't generate the subsequent file, it keeps reporting this error, I want to know what is the cause of this problem.

Run accident inference... Traceback (most recent call last): File "demo.py", line 354, in from src.Models import UString File "/home/wzp/anaconda3/envs/py37/UString/src/Models.py", line 10, in from torch_geometric.utils import remove_self_loops, add_self_loops File "/home/wzp/anaconda3/envs/py37/lib/python3.7/site-packages/torch_geometric/init.py", line 2, in import torch_geometric.nn File "/home/wzp/anaconda3/envs/py37/lib/python3.7/site-packages/torch_geometric/nn/init.py", line 2, in from .data_parallel import DataParallel File "/home/wzp/anaconda3/envs/py37/lib/python3.7/site-packages/torch_geometric/nn/data_parallel.py", line 5, in from torch_geometric.data import Batch File "/home/wzp/anaconda3/envs/py37/lib/python3.7/site-packages/torch_geometric/data/init.py", line 1, in from .data import Data File "/home/wzp/anaconda3/envs/py37/lib/python3.7/site-packages/torch_geometric/data/data.py", line 7, in from torch_sparse import coalesce File "/home/wzp/anaconda3/envs/py37/lib/python3.7/site-packages/torch_sparse/init.py", line 2, in from .coalesce import coalesce File "/home/wzp/anaconda3/envs/py37/lib/python3.7/site-packages/torch_sparse/coalesce.py", line 2, in import torch_scatter File "/home/wzp/anaconda3/envs/py37/lib/python3.7/site-packages/torch_scatter/init.py", line 3, in from .mul import scatter_mul File "/home/wzp/anaconda3/envs/py37/lib/python3.7/site-packages/torch_scatter/mul.py", line 3, in from torch_scatter.utils.ext import get_func File "/home/wzp/anaconda3/envs/py37/lib/python3.7/site-packages/torch_scatter/utils/ext.py", line 2, in import torch_scatter.scatter_cpu ImportError: libtorch_cpu.so: cannot open shared object file: No such file or directory

Cogito2012 commented 2 years ago

@wangzhipeng2020 It looks like your torch_geometric package was not properly installed. My previous experience is that most of the following packages are mutually dependent. So, I recommend you to check the versions of these packages to see if they are exactly the same as the followings.

torch==1.2.0
torchvision==0.4.0
torch_geometric==1.3.2
torch_scatter==1.4.0
torch_cluster==1.4.5
torch_sparse==0.4.3
pradheepram commented 2 years ago

@Cogito2012, in readme it states 'Python=3.7.4 and PyTorch=1.0.0 with CUDA=10.0.130 and cuDNN=7.6.3' but requirements file has torch 1.2.0 and torch_scatter 1.4.0 seems to require torch 1.4.0, how to deal with this pls help.

Cogito2012 commented 2 years ago

@pradheepram I'm not sure what's going on...Actually, I prefer to recommend you fully uninstall pytorch and torch-geometric from your python env, then follow the latest torch_geometric installation: https://pytorch-geometric.readthedocs.io/en/latest/notes/installation.html. Some of the APIs may have changed, but it deserves to have a try for future research.

Alternatively, you can also replace the GCN module with the code from this repo: https://github.com/meliketoy/graph-cnn.pytorch, which is purely based on pytorch without the 3rd lib.

wangzhipeng2020 commented 2 years ago

@Cogito2012 I still cannot solve my problem. It sames that the code is based on cpu, however, we build the gpu environment.

pradheepram commented 2 years ago

@Cogito2012

i'm trying to just extract features from a single video as a feature file

the from mmdet.apis import init_detector, inference_detector seems to not work, i think it could be because the mmdet is latest, which version of mmdet are you using.

Cogito2012 commented 2 years ago

@Cogito2012

i'm trying to just extract features from a single video as a feature file

the from mmdet.apis import init_detector, inference_detector seems to not work, i think it could be because the mmdet is latest, which version of mmdet are you using.

I was using mmdet 1.1.0, see the README Line 73