EVF-SAM icon indicating copy to clipboard operation
EVF-SAM copied to clipboard

ImportError: Failed to map segment from shared object for _C.so

Open VoyageWang opened this issue 4 months ago • 2 comments

ImportError: Failed to map segment from shared object for _C.so

描述: run the code: python demo_video.py segmentation/evf-sam2-multitask ImportError: /EVF-SAM/model/segment_anything_2/sam2/_C.so: failed to map segment from shared object

I have successfully compiled the code using python setup.py build_ext --inplace

/miniconda3/envs/evf-sam/lib/python3.10/site-packages/torch/utils/cpp_extension.py:428: UserWarning: There are no g++ version bounds defined for CUDA version 12.1 warnings.warn(f'There are no {compiler_name} version bounds defined for CUDA version {cuda_str_version}') building 'sam2._C' extension /miniconda3/envs/evf-sam/lib/python3.10/site-packages/torch/utils/cpp_extension.py:1967: UserWarning: TORCH_CUDA_ARCH_LIST is not set, all archs for visible cards are included for compilation. If this is not desired, please set os.environ['TORCH_CUDA_ARCH_LIST']. warnings.warn( Emitting ninja build file EVF-SAM/model/segment_anything_2/build/temp.linux-x86_64-cpython-310/build.ninja... Compiling objects... Allowing ninja to set a default number of workers... (overridable by setting the environment variable MAX_JOBS=N) ninja: no work to do. g++ -pthread -B /miniconda3/envs/evf-sam/compiler_compat -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -fPIC -O2 -isystem miniconda3/envs/evf-sam/include -fPIC -O2 -isystem miniconda3/envs/evf-sam/include -pthread -B miniconda3/envs/evf-sam/compiler_compat -shared //EVF-SAM/model/segment_anything_2/build/temp.linux-x86_64-cpython-310/sam2/csrc/connected_components.o -Lminiconda3/envs/evf-sam/lib/python3.10/site-packages/torch/lib -L/cuda/cuda-12.1/lib64 -lc10 -ltorch -ltorch_cpu -ltorch_python -lcudart -lc10_cuda -ltorch_cuda -o build/lib.linux-x86_64-cpython-310/sam2/_C.so copying build/lib.linux-x86_64-cpython-310/sam2/_C.so -> sam2

How to solve it, thanks for your attention!!!!

VoyageWang avatar Sep 26 '24 06:09 VoyageWang