uzh-rpg / rpg_vid2e

Open source implementation of CVPR 2020 "Video to Events: Recycling Video Dataset for Event Cameras"
GNU General Public License v3.0
325 stars 80 forks source link

ModuleNotFoundError: No module named 'esim_torch' #44

Closed Minglin-Chen closed 2 years ago

Minglin-Chen commented 2 years ago

I successfully compiled and installed the _esimtorch package with the commands:

cd rpg_vid2e/esim_torch
pip install .

However, I got the following errors while trying python test/test.py:

Traceback (most recent call last): File "/xxx/rpg_vid2e/esim_torch/test/test.py", line 7, in import esim_torch ModuleNotFoundError: No module named 'esim_torch'

Minglin-Chen commented 2 years ago

I fixed this with the following two steps: Step 1: move the directory _rpg_vid2e/esim_torch/src/esimtorch by the following commands:

mv -r rpg_vid2e/esim_torch/src/esim_torch rpg_vid2e/esim_torch/

Step 2: modify the file _rpg_vid2e/esimtorch/setup.py as:

from setuptools import setup
from torch.utils.cpp_extension import BuildExtension, CUDAExtension

setup(
    name='esim_torch',
    packages=['esim_torch'], # package_dir={'':'src'},
    ext_modules=[
        CUDAExtension(name='esim_cuda',
                      sources=[
                      'esim_torch/esim_cuda_kernel.cu', # 'src/esim_torch/esim_cuda_kernel.cu',
                      ],
                     # extra_compile_args={
                     #'cxx': ['-g'],
                     #'nvcc': ['-arch=sm_60', '-O3', '-use_fast_math']
                     #}
                     )
    ],
    cmdclass={
        'build_ext': BuildExtension
    })
gintautas12358 commented 2 years ago

thanks mlchen666, you saved me a day or two

EMJian commented 2 years ago

Thanks a lot. It works for me.

hjyyyd commented 2 years ago

step3: in the file esim_torch/scripts/generate_events.py: change: import esim_torch to: from esim_torch import esim_torch

danielgehrig18 commented 2 years ago

This should be fixed with the latest commit, it was an issue with the setup.py