facebookresearch / robust_cvd

Robust Consistent Video Depth Estimation
https://robust-cvd.github.io/
Other
298 stars 24 forks source link

No Module Named 'lib_python' Error In Colab. #28

Open FoxLynx64 opened 2 years ago

FoxLynx64 commented 2 years ago

I managed to download Detectron2 using other methods than the ones provided and switched the OpenCV version from 3.4.2.16 to 3.4.2.17 since you can no longer install 16. Now I get no errors while installing everything, except that when I go to run the Robust CVD code, it tells me that lib_python is not installed. Here is the code: /content/cvd2 ['/content/cvd2', '/env/python', '/usr/lib/python37.zip', '/usr/lib/python3.7', '/usr/lib/python3.7/lib-dynload', '/usr/local/lib/python3.7/dist-packages', '/content/detectron2_repo', '/usr/lib/python3/dist-packages', '/content/cvd2/main.py', 'lib/build'] Traceback (most recent call last): File "main.py", line 12, in <module> from params import Video3dParamsParser File "/content/cvd2/params.py", line 8, in <module> from depth_fine_tuning import DepthFineTuningParams File "/content/cvd2/depth_fine_tuning.py", line 30, in <module> from loaders.video_dataset import VideoDataset, VideoFrameDataset File "/content/cvd2/loaders/video_dataset.py", line 16, in <module> from lib_python import (DepthVideo, ValueXformType, DepthXformType, SpatialXformType) ModuleNotFoundError: No module named 'lib_python'

yohannes-taye commented 2 years ago

+1

maxcelar commented 2 years ago

+1

manhkhanhad commented 2 years ago

do you get the solution? @FoxLynx64

kumarav1 commented 1 year ago

Add the following two lines in "video_dataset.py" just before the line "from lib_python import (DepthVideo, ValueXformType, DepthXformType, SpatialXformType)"

import sys sys.path.append('lib\build\Release')

This will work given the earlier step of building C++ code in lib directory succeeded using the CMakeLists.txt in lib folder. In windows, the Release version of lib_python.lib are built in lib\build\Release

enriquegv001 commented 1 year ago

Add the following two lines in "video_dataset.py" just before the line "from lib_python import (DepthVideo, ValueXformType, DepthXformType, SpatialXformType)"

import sys sys.path.append('lib\build\Release')

This will work given the earlier step of building C++ code in lib directory succeeded using the CMakeLists.txt in lib folder. In windows, the Release version of lib_python.lib are built in lib\build\Release

This didn't work for me, at least, because the directory lib\build\Release doesn't exist, nor the file lib_python.

I try your idea, with some modifications. The system path is only 'lib' and the modules now I import modules from their respective files where the classes have been defined:

sys.path.append('lib')
print('\n', sys.path)
from lib.DepthVideo import DepthVideo
from lib.ValueTransform import ValueXformType
from lib.DepthMapTransform import DepthXformType
from lib.DepthMapTransform import SpatialXformType

However, this didn't work either. I believe it has to do with the project still looking for lib_python inside CMakeLists.txt. But I am not sure how this file works.

Has anyone found another solution for the issue?