v-iashin / video_features

Extract video features from raw videos using multiple GPUs. We support RAFT flow frames as well as S3D, I3D, R(2+1)D, VGGish, CLIP, and TIMM models.
https://v-iashin.github.io/video_features
MIT License
509 stars 95 forks source link

OSError with Anaconda, works on Miniconda #25

Closed ChenyuLy closed 8 months ago

ChenyuLy commented 2 years ago

Hi , this is a greate work for my stduy ,But I had a problem running the demo.

(torch_zoo) czy@PT6630W:/data1/czy/affectivevideo/video_features$ /home/czy/anaconda3/envs/torch_zoo/bin/python3.8 main.py feature_type=r21d device_ids="[0]" video_paths="[./sample/v_ZNVhz7ctTq0.mp4, ./sample/v_GGSY1Qvo990.mp4]"
Traceback (most recent call last):
  File "main.py", line 6, in <module>
    import torch
  File "/home/czy/anaconda3/envs/torch_zoo/lib/python3.8/site-packages/torch/__init__.py", line 189, in <module>
    _load_global_deps()
  File "/home/czy/anaconda3/envs/torch_zoo/lib/python3.8/site-packages/torch/__init__.py", line 142, in _load_global_deps
    ctypes.CDLL(lib_path, mode=ctypes.RTLD_GLOBAL)
  File "/home/czy/anaconda3/envs/torch_zoo/lib/python3.8/ctypes/__init__.py", line 381, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: /home/czy/anaconda3/envs/torch_zoo/lib/python3.8/site-packages/torch/lib/../../../../libcublas.so.11: symbol free_gemm_select version libcublasLt.so.11 not defined in file libcublasLt.so.11 with link time reference

Is there any way to solve this problem?Looking forward to someone's reply. Thanks

v-iashin commented 2 years ago

Hi, thanks for trying it out.

Can you do import torch in your Python?

ChenyuLy commented 2 years ago

Hi, thanks for trying it out.

Can you do import torch in your Python?

I can't import torch in my python . same error

ChenyuLy commented 2 years ago

concretely

(torch_zoo) czy@PT6630W:/data1/czy/affectivevideo/video_features$ python 
Python 3.8.5 (default, Sep  4 2020, 07:30:14) 
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/czy/anaconda3/envs/torch_zoo/lib/python3.8/site-packages/torch/__init__.py", line 189, in <module>
    _load_global_deps()
  File "/home/czy/anaconda3/envs/torch_zoo/lib/python3.8/site-packages/torch/__init__.py", line 142, in _load_global_deps
    ctypes.CDLL(lib_path, mode=ctypes.RTLD_GLOBAL)
  File "/home/czy/anaconda3/envs/torch_zoo/lib/python3.8/ctypes/__init__.py", line 381, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: /home/czy/anaconda3/envs/torch_zoo/lib/python3.8/site-packages/torch/lib/../../../../libcublas.so.11: symbol free_gemm_select version libcublasLt.so.11 not defined in file libcublasLt.so.11 with link time reference
>>> 
v-iashin commented 2 years ago

It could be an issue of anaconda as it is described in https://github.com/pytorch/pytorch/issues/51080 and in https://github.com/ContinuumIO/anaconda-issues/issues/12251

What does (torch_zoo) conda list cuda give you?

ChenyuLy commented 2 years ago

yes and I tried another version of cudatoolkit such as cudatoolkit=11.0.3 ,But There seems to be conflict

(torch_zoo) czy@PT6630W:/data1/czy/affectivevideo/video_features$ conda list cuda
# packages in environment at /home/czy/anaconda3/envs/torch_zoo:
#
# Name                    Version                   Build  Channel
cudatoolkit               11.0.221             h6bb024c_0  
v-iashin commented 2 years ago

I don't have another machine right now. Is it possible for you to try to install miniconda and torch_zoo there? I just want to narrow down the issue a bit.

ChenyuLy commented 2 years ago

I don't have another machine right now. Is it possible for you to try to install miniconda and torch_zoo there? I just want to narrow down the issue a bit.

I'll try and Reply later

ChenyuLy commented 2 years ago

It seems to succeed. \I think my Anaconda has some problems XD

czy1@PT6630W:~/video_features$ source activate torch_zoo
(torch_zoo) czy1@PT6630W:~/video_features$ python main.py feature_type=r21d  device_ids="[0]" video_paths="[./sample/v_ZNVhz7ctTq0.mp4, ./sample/v_GGSY1Qvo990.mp4]"
{'feature_type': 'r21d', 'device_ids': [0], 'video_paths': ['./sample/v_ZNVhz7ctTq0.mp4', './sample/v_GGSY1Qvo990.mp4']}
feature_type: r21d
model_name: r2plus1d_18_16_kinetics
stack_size: null
step_size: null
extraction_fps: null
device_ids:
- 0
on_extraction: print
output_path: ./output
tmp_path: ./tmp
keep_tmp_files: false
show_pred: false
config: null
file_with_video_paths: null
video_paths:
- ./sample/v_ZNVhz7ctTq0.mp4
- ./sample/v_GGSY1Qvo990.mp4

  0%|                                                                                                                                                                  | 0/2 [00:00<?, ?it/s]Downloading: "https://download.pytorch.org/models/r2plus1d_18-91a641e6.pth" to /home/czy1/.cache/torch/hub/checkpoints/r2plus1d_18-91a641e6.pth
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 120M/120M [00:54<00:00, 2.31MB/s]
r21d|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▉| 120M/120M [00:54<00:00, 2.32MB/s]
[[0.42218563 1.17318308 0.40078551 ... 0.66922128 0.06912617 1.18522477]
 [0.52843308 0.86638242 0.48396972 ... 0.87221068 0.06446913 1.26957393]
 [0.45510957 1.24178052 0.28735891 ... 1.1974194  0.04069321 1.1834774 ]
 ...
 [0.36844271 0.72178376 0.43043154 ... 1.50390053 0.64477223 0.92311001]
 [0.36785939 0.57711715 0.39524844 ... 1.55858362 0.47291428 0.55648011]
 [0.26900989 0.62733668 0.15515861 ... 1.86467552 0.16260292 0.45022029]]
max: 5.85777378; mean: 0.97725581; min: 0.00000000

 50%|█████████████████████████████████████████████████████████████████████████████                                                                             | 1/2 [01:01<01:01, 61.32s/it]r21d
[[0.29430833 0.61677468 0.03131339 ... 0.46447253 0.11309772 0.30705026]
 [0.45730111 0.7090205  0.05734326 ... 0.51096797 0.24674344 0.5347752 ]
 [0.53560811 0.64860499 0.03306999 ... 0.41103086 0.22505628 0.42674282]
 ...
 [0.76564747 1.35982907 0.32192281 ... 0.85664588 0.33740634 0.84231055]
 [0.39216471 0.7261017  0.24165478 ... 0.12450667 0.13376112 0.73523462]
 [0.2450196  0.74660909 0.27728859 ... 0.25958988 0.46994063 0.82153547]]
max: 5.41354084; mean: 0.73186871; min: 0.00046144

100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [01:02<00:00, 31.39s/it]
v-iashin commented 2 years ago

Can you compare lists of installed packages side by side? Is there any difference?

(anaconda) conda list > anaconda.yaml 
(miniconda) conda list > miniconda.yaml
diff anaconda.yaml miniconda.yaml
ChenyuLy commented 2 years ago

They have many differences

ChenyuLy commented 2 years ago

miniconda.txt anaconda.txt

v-iashin commented 2 years ago

Ok. I think I am fine with this issue and I will consider it a low priority.

Anyway, thanks for bringing this up and providing more follow-up info on my request. I will leave it open for others to see.

Others, please let me know if you have the same problem as the topic starter. It would be especially useful if someone could help me to fix it (i.e. making it work on anaconda).

ChenyuLy commented 2 years ago

Thanks

v-iashin commented 2 years ago

I will reopen it. So, someone else with a similar problem could see.

v-iashin commented 8 months ago

The environment has been substantially upgraded in #118 and it should mitigate this issue.