eduardohenriquearnold/fastreg

No module named 'torch.profiler'

DioBakery opened this issue · 5 comments

Hi, thank for your work, there are some problems:
when i run train.py, there is an error message: No module named 'torch.profiler'
this link https://discuss.pytorch.org/t/problem-to-load-the-torch-profiler-module/127956 says the new profiler was released in 1.8.1, but the version you used is 1.7.1, so what should i do?

Hi, can you please post the full traceback of the error? I don't think torch.profiler is directly called anywhere in the codebase so I'm curious where this call is happening.

(fastreg) usr@CGY-PC:~/fastreg$ python train.py DATASET
Traceback (most recent call last):
File "train.py", line 10, in
from lib.models.fastreg import FastReg
File "/home/usr/fastreg/lib/models/fastreg.py", line 7, in
from lib.models.attention import GNNAttention
File "/home/usr/fastreg/lib/models/attention.py", line 3, in
from torch_geometric.nn import knn_graph, knn, CGConv
File "/home/usr/anaconda3/envs/fastreg/lib/python3.7/site-packages/torch_geometric/init.py", line 9, in
import torch_geometric.profile
File "/home/usr/anaconda3/envs/fastreg/lib/python3.7/site-packages/torch_geometric/profile/init.py", line 1, in
from .profile import profileit, timeit, get_stats_summary
File "/home/usr/anaconda3/envs/fastreg/lib/python3.7/site-packages/torch_geometric/profile/profile.py", line 8, in
from torch.profiler import ProfilerActivity, profile
ModuleNotFoundError: No module named 'torch.profiler'

I believe you need to install torch_geometric <= 1.7.2, which does not include the torch.profiler dependency. Can you try downgrading and see if that resolves the issue?

Hi, thank you for your work, I have a same problem.
While after I import torch 1.13.0+cu117, there is an another error:

Traceback (most recent call last):
  File "train.py", line 10, in <module>
    from lib.models.fastreg import FastReg
  File "/media/yunan/hdd/fastreg/lib/models/fastreg.py", line 4, in <module>
    from lib.pointnet2.pointnet2_utils import three_nn
  File "/media/yunan/hdd/fastreg/lib/pointnet2/pointnet2_utils.py", line 7, in <module>
    import pointnet2_cuda as pointnet2

ImportError: /home/yunan/anaconda3/envs/fastreg/lib/python3.7/site-packages/pointnet2-0.0.0-py3.7-linux-x86_64.egg/pointnet2_cuda.cpython-37m-x86_64-linux-gnu.so: undefined symbol: _ZN6caffe28TypeMeta21_typeMetaDataInstanceIdEEPKNS_6detail12TypeMetaDataEv

I think it is becuase the different version after I installed your environment.yml but pip install higher version of torch, I wonder how can I fix this problem?

@Joy881007 apologies for the delay in replying. I have now provided a Docker image that should make it much easier to use the code, please see guide. You can also try to use the updated environment.yml however I strongly recommend using the provided Docker image.

I'm closing this issue for now.