visionml / pytracking

Visual tracking library based on PyTorch.
GNU General Public License v3.0
3.23k stars 605 forks source link

_prroi_pooling.so: cannot open shared object file #330

Open vahmelk99 opened 2 years ago

vahmelk99 commented 2 years ago

I'm trying to run the tracker with a webcam or in a video but it gives this error: ImportError: /home/user/.cache/torch_extensions/py39_cu113/_prroi_pooling/_prroi_pooling.so: cannot open shared object file: No such file or directory and ImportError: Can not compile Precise RoI Pooling library.

Here is my Traceback: /home/user/Documents/Computer Vision/pytracking/pytracking/../pytracking/features/preprocessing.py:109: UserWarning: floordiv is deprecated, and its behavior will change in a future version of pytorch. It currently rounds toward 0 (like the 'trunc' function NOT 'floor'). This results in incorrect rounding for negative values. To keep the current behavior, use torch.div(a, b, rounding_mode='trunc'), or for actual floor division, use torch.div(a, b, rounding_mode='floor'). tl = posl - (szl - 1) // 2 /home/user/Documents/Computer Vision/pytracking/pytracking/../pytracking/features/preprocessing.py:110: UserWarning: floordiv is deprecated, and its behavior will change in a future version of pytorch. It currently rounds toward 0 (like the 'trunc' function NOT 'floor'). This results in incorrect rounding for negative values. To keep the current behavior, use torch.div(a, b, rounding_mode='trunc'), or for actual floor division, use torch.div(a, b, rounding_mode='floor'). br = posl + szl//2 + 1 /home/user/anaconda3/envs/pytracking/lib/python3.9/site-packages/torch/nn/functional.py:3631: UserWarning: Default upsampling behavior when mode=bilinear is changed to align_corners=False since 0.4.0. Please specify align_corners=True if the old behavior is desired. See the documentation of nn.Upsample for details. warnings.warn( Using /home/user/.cache/torch_extensions/py39_cu113 as PyTorch extensions root... Detected CUDA files, patching ldflags Emitting ninja build file /home/user/.cache/torch_extensions/py39_cu113/_prroi_pooling/build.ninja... Building extension module _prroi_pooling... Allowing ninja to set a default number of workers... (overridable by setting the environment variable MAX_JOBS=N) 1.10.0 Loading extension module _prroi_pooling... Traceback (most recent call last): File "/home/user/Documents/Computer Vision/pytracking/pytracking/../ltr/external/PreciseRoIPooling/pytorch/prroi_pool/functional.py", line 30, in _import_prroi_pooling _prroi_pooling = load_extension( File "/home/user/anaconda3/envs/pytracking/lib/python3.9/site-packages/torch/utils/cpp_extension.py", line 1124, in load return _jit_compile( File "/home/user/anaconda3/envs/pytracking/lib/python3.9/site-packages/torch/utils/cpp_extension.py", line 1362, in _jit_compile return _import_module_from_library(name, build_directory, is_python_module) File "/home/user/anaconda3/envs/pytracking/lib/python3.9/site-packages/torch/utils/cpp_extension.py", line 1752, in _import_module_from_library module = importlib.util.module_from_spec(spec) File "", line 565, in module_from_spec File "", line 1173, in create_module File "", line 228, in _call_with_frames_removed ImportError: /home/user/.cache/torch_extensions/py39_cu113/_prroi_pooling/_prroi_pooling.so: cannot open shared object file: No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/user/Documents/Computer Vision/pytracking/pytracking/run_webcam.py", line 41, in main() File "/home/user/Documents/Computer Vision/pytracking/pytracking/run_webcam.py", line 37, in main run_webcam(args.tracker_name, args.tracker_param, args.debug, visdom_info) File "/home/user/Documents/Computer Vision/pytracking/pytracking/run_webcam.py", line 22, in run_webcam tracker.run_webcam(debug, visdom_info) File "/home/user/Documents/Computer Vision/pytracking/pytracking/../pytracking/evaluation/tracker.py", line 451, in run_webcam out = tracker.track(frame, info) File "/home/user/Documents/Computer Vision/pytracking/pytracking/../pytracking/evaluation/multi_object_wrapper.py", line 165, in track out = self.trackers[obj_id].initialize(image, init_info_split[obj_id]) File "/home/user/Documents/Computer Vision/pytracking/pytracking/../pytracking/tracker/dimp/dimp.py", line 84, in initialize self.init_classifier(init_backbone_feat) File "/home/user/Documents/Computer Vision/pytracking/pytracking/../pytracking/tracker/dimp/dimp.py", line 573, in init_classifier self.targetfilter, , losses = self.net.classifier.get_filter(x, target_boxes, num_iter=num_iter, File "/home/user/Documents/Computer Vision/pytracking/pytracking/../ltr/models/target_classifier/linear_filter.py", line 97, in get_filter weights = self.filter_initializer(feat, bb) File "/home/user/anaconda3/envs/pytracking/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl return forward_call(*input, kwargs) File "/home/user/Documents/Computer Vision/pytracking/pytracking/../ltr/models/target_classifier/initializer.py", line 164, in forward weights = self.filter_pool(feat, bb) File "/home/user/anaconda3/envs/pytracking/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl return forward_call(*input, *kwargs) File "/home/user/Documents/Computer Vision/pytracking/pytracking/../ltr/models/target_classifier/initializer.py", line 45, in forward return self.prroi_pool(feat, roi1) File "/home/user/anaconda3/envs/pytracking/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl return forward_call(input, kwargs) File "/home/user/Documents/Computer Vision/pytracking/pytracking/../ltr/external/PreciseRoIPooling/pytorch/prroi_pool/prroi_pool.py", line 28, in forward return prroi_pool2d(features, rois, self.pooled_height, self.pooled_width, self.spatial_scale) File "/home/user/Documents/Computer Vision/pytracking/pytracking/../ltr/external/PreciseRoIPooling/pytorch/prroi_pool/functional.py", line 44, in forward _prroi_pooling = _import_prroi_pooling() File "/home/user/Documents/Computer Vision/pytracking/pytracking/../ltr/external/PreciseRoIPooling/pytorch/prroi_pool/functional.py", line 36, in _import_prroi_pooling raise ImportError('Can not compile Precise RoI Pooling library.') ImportError: Can not compile Precise RoI Pooling library.

Ahsanr312 commented 2 years ago

Try it by first fixing your path which is "/home/user/Documents/Computer Vision/pytracking/pytracking/" remove the space between "Computer Vision" either by removing the space or adding an underscore. Then check

vahmelk99 commented 2 years ago

It isn't the case because path is given with " so it understand the path.

Ahsanr312 commented 2 years ago

@vahmelk99 Have you solved the problem? Which cuda and pytorch version have you installed ?

vahmelk99 commented 2 years ago

No. CUDA Version: 11.6

conda list | grep pytorch: pytorch 1.10.1 py3.9_cuda11.3_cudnn8.2.0_0 pytorch

pytorch-mutex 1.0 cuda pytorch

torchaudio 0.10.1 py39_cu113 pytorch

torchvision 0.11.2 py39_cu113 pytorch

Ahsanr312 commented 2 years ago

I solved this issue by creating a virtual env and installing pytorch 1.10.0 with cuda 11.1 Keep your current installation and try this in virtual env.