zju3dv / OnePose_Plus_Plus

Code for "OnePose++: Keypoint-Free One-Shot Object Pose Estimation without CAD Models" NeurIPS 2022
Apache License 2.0
378 stars 46 forks source link

import DeepLM have error? ModuleNotFoundError: No module named 'LMCore' #29

Open lunalulu opened 1 year ago

lunalulu commented 1 year ago

i have successfully instrall DeepLM like below nop errors: `git submodule update --init --recursive

Install DeepLM

cd submodules/DeepLM sh example.sh cp ${REPO_ROOT}/backup/deeplm_init_backup.py ${REPO_ROOT}/submodules/DeepLM/init.py`

but when i import DeepLM, it return ModuleNotFoundError: No module named 'LMCore'

@hxy-123

thanks~

krishna-esrlabs commented 1 year ago

@lunalulu it expects some env variables to be set, to successfully import, here is the snippet that solves the import issue.

conda activate oneposeplus
cd $CONDA_PREFIX
mkdir -p ./etc/conda/activate.d
mkdir -p ./etc/conda/deactivate.d
touch ./etc/conda/activate.d/env_vars.sh
touch ./etc/conda/deactivate.d/env_vars.sh

Edit ./etc/conda/activate.d/env_vars.sh as

#!/bin/sh
export TORCH_USE_RTLD_GLOBAL=YES
export OLD_PYTHONPATH=$PYTHONPATH
export PYTHONPATH=$PYTHONPATH:${REPO_ROOT}/submodules/DeepLM/build

Edit ./etc/conda/deactivate.d/env_vars.sh as

#!/bin/sh
unset TORCH_USE_RTLD_GLOBAL
export PYTHONPATH=$OLD_PYTHONPATH
unset OLD_PYTHONPATH
lekshmijk commented 1 year ago

Hi @lunalulu ans @krishna-esrlabs, I'm facing a similar issue except when i get the error ModuleNotFoundError: No module named 'BACore' The terminal looks like this:

`(oppp) linux@os:~/Desktop/Workspace/OnePose_Plus_Plus/submodules/DeepLM$ sh example.sh -- The CXX compiler identification is GNU 11.3.0 -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /usr/bin/c++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Found OpenMP_CXX: -fopenmp (found version "4.5") -- Found OpenMP: TRUE (found version "4.5")
-- The CUDA compiler identification is unknown CMake Error at /home/linux/miniconda3/envs/oppp/lib/python3.8/site-packages/cmake/data/share/cmake-3.25/Modules/CMakeDetermineCUDACompiler.cmake:603 (message): Failed to detect a default CUDA architecture.

Compiler output:

Call Stack (most recent call first): CMakeLists.txt:6 (enable_language)

-- Configuring incomplete, errors occurred! See also "/home/linux/Desktop/Workspace/OnePose_Plus_Plus/submodules/DeepLM/build/CMakeFiles/CMakeOutput.log". See also "/home/linux/Desktop/Workspace/OnePose_Plus_Plus/submodules/DeepLM/build/CMakeFiles/CMakeError.log". make: *** No targets specified and no makefile found. Stop. mkdir: cannot create directory ‘data’: File exists --2023-06-11 19:06:38-- https://grail.cs.washington.edu/projects/bal/data/ladybug/problem-49-7776-pre.txt.bz2 Resolving grail.cs.washington.edu (grail.cs.washington.edu)... 2607:4000:200:14::5d, 128.208.5.93 Connecting to grail.cs.washington.edu (grail.cs.washington.edu)|2607:4000:200:14::5d|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 448484 (438K) [application/x-bzip2] Saving to: ‘problem-49-7776-pre.txt.bz2’

problem-49-7776-pre.txt.bz2 100%[==================================================>] 437.97K 508KB/s in 0.9s

2023-06-11 19:06:39 (508 KB/s) - ‘problem-49-7776-pre.txt.bz2’ saved [448484/448484]

Traceback (most recent call last): File "examples/BundleAdjuster/bundle_adjuster.py", line 5, in import BACore ModuleNotFoundError: No module named 'BACore' `

I tried what you have said @krishna-esrlabs, but I get the same error...

krishna-esrlabs commented 1 year ago

@lekshmijk

-- The CUDA compiler identification is unknown
CMake Error at /home/linux/miniconda3/envs/oppp/lib/python3.8/site-packages/cmake/data/share/cmake-3.25/Modules/CMakeDetermineCUDACompiler.cmake:603 (message):
Failed to detect a default CUDA architecture.

Your compilation failed because of this reason. Either the Cuda compiler is missing or the CMake is unable to find it. Check nvcc --version, if it is there add the cuda path so that CMake can find it.