MitchFuchs / asbar

ASBAR (for Animal Skeleton-Based Action Recognition) can recognize animal behaviors from videos using pose estimation.
MIT License
10 stars 0 forks source link

deeplabcut models not available/not running #1

Closed P-eMartin closed 8 months ago

P-eMartin commented 1 year ago

After installation steps, running the GUI and selecting DeepLabCut model with all keypoints (or any) with all visibility (or only visible):

ls: cannot access './models/deeplabcut/': No such file or directory
importing dlc
2023-11-20 15:43:01.861789: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcudart.so.11.0
Loading DLC 2.2.3...
DLC loaded in light mode; you cannot use any GUI (labeling, relabeling and standalone GUI)
Traceback (most recent call last):
  File "main.py", line 71, in <module>
    main()
  File "main.py", line 65, in main
    use_deeplabcut(args, cfg)
  File "main.py", line 35, in use_deeplabcut
    from tools.dlc_utils import DLC
  File "/data/ProcessedData/user/Github/asbar/tools/dlc_utils.py", line 13, in <module>
    import deeplabcut as dlc
  File "/home/user/.conda/envs/asbar/lib/python3.8/site-packages/deeplabcut/__init__.py", line 78, in <module>
    from deeplabcut.pose_tracking_pytorch import transformer_reID
  File "/home/user/.conda/envs/asbar/lib/python3.8/site-packages/deeplabcut/pose_tracking_pytorch/__init__.py", line 12, in <module>
    from .train_dlctransreid import train_tracking_transformer
  File "/home/user/.conda/envs/asbar/lib/python3.8/site-packages/deeplabcut/pose_tracking_pytorch/train_dlctransreid.py", line 12, in <module>
    import torch
  File "/home/user/.conda/envs/asbar/lib/python3.8/site-packages/torch/__init__.py", line 189, in <module>
    _load_global_deps()
  File "/home/user/.conda/envs/asbar/lib/python3.8/site-packages/torch/__init__.py", line 142, in _load_global_deps
    ctypes.CDLL(lib_path, mode=ctypes.RTLD_GLOBAL)
  File "/home/user/.conda/envs/asbar/lib/python3.8/ctypes/__init__.py", line 373, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: /home/user/.conda/envs/asbar/lib/python3.8/site-packages/torch/lib/../../../../libcublas.so.11: undefined symbol: free_gemm_select, version libcublasLt.so.11

Running on Ubuntu 20.04.6 LTS (GNU/Linux 5.15.0-88-generic x86_64)

MitchFuchs commented 1 year ago

Hi @P-eMartin,

Thanks for using asbar! Let's fix the issues you are encountering.

1) ls: cannot access './models/deeplabcut/': No such file or directory --> i have just fixed the code, so that the deeplabcut folder is created. You can either update your local repo or simply manually create a folder called "deeplabcut" in the existing "models" folder.

2) it seems that you are encountering an issue with your pytorch installation. can you test that torch has cuda enable but running the following code in Python: import torch torch.cuda.is_available()

is the statement is False try to reinstall pytorch using

conda install pytorch==1.7.0 torchvision==0.8.0 torchaudio==0.7.0 cudatoolkit=11.0 -c pytorch

Let me know if this solves your issue.

Cheers, Mitch

P-eMartin commented 1 year ago

Dear Mitch, Thanks.

  1. -> all good.
  2. it did not but this did:
    conda install -y -c conda-forge -c pytorch pytorch cudatoolkit=11.1

    as suggested in https://github.com/pytorch/pytorch/issues/51080#issuecomment-787133939 This may be hardware dependant. We are facing some driver s incompatibility and may have affected the installation of the conda environment.

Any chance to have a demo of your pre-trained models on this repo? Best

MitchFuchs commented 1 year ago

Hi @P-eMartin,

Great to hear that your issue was solved.

Yes of course, I have just added to the repo the final models for deeplabcut and mmaction2 in the folder 'pretrained_models'.

Once you created a deeplabcut model with the GUI you can add the 3 files in the folder corresponding to: asbar/models/deeplabcut//dlc-models///train/

The model will be used by deeplabcut to analyze videos when you choose Mmaction2 --> create dataset in the GUI

Let me know if you need anything else.

Cheers, Mitch