ModuleNotFoundError: No module named 'esim_torch'
Minglin-Chen opened this issue · 5 comments
I successfully compiled and installed the esim_torch 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'
I fixed this with the following two steps:
Step 1: move the directory rpg_vid2e/esim_torch/src/esim_torch by the following commands:
mv -r rpg_vid2e/esim_torch/src/esim_torch rpg_vid2e/esim_torch/
Step 2: modify the file rpg_vid2e/esim_torch/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
})
thanks mlchen666, you saved me a day or two
Thanks a lot. It works for me.
step3: in the file esim_torch/scripts/generate_events.py:
change:
import esim_torch
to:
from esim_torch import esim_torch
This should be fixed with the latest commit, it was an issue with the setup.py