Error when replicating ViTPose

#5
by AeroDEmi - opened

Hello, I'm trying to create a local machine with ViTPose app, but when making the Pose estimation model I'm getting this error: KeyError: 'ViT is not in the models registry' and KeyError: "TopDown: 'ViT is not in the models registry'". I have tried installing mmcv with mim but I still get the error.

I can load the first model and use it but the pose model is the one I'm struggling to create

Here are my pip installations on my notebook:

!pip install mmcv-full==1.5.0
!pip install mmdet==2.24.1
!pip install  mmpose==0.25.1
!pip install openmim==0.1.5
!pip install timm==0.5.4

And I've tried with mim:

!pip install -U openmim
import mim
mim.uninstall('mmcv-full')
mim.install(['mmcv-full==1.5.0'], is_yes=True)

Solved,
I've just needed mmpose and mmcv_custom from the github repo and add them as custom modules.

AeroDEmi changed discussion status to closed

HI, can you please explain what you did exactly? im stuck at the same point and Im new to cv in general. Much appreciated

Hi, I also have the same problem, can you tell me how do you overcome it? Thx a lot.

This problem can be solved by copying mmpose and mmcv_custom from the github repo to your ViTPose directory, and adding the code below into the python file you want to execute.
import sys
import pathlib
mmpose_path = str(pathlib.Path(file).parent / "mmpose")
mmcv_custom_path = str(pathlib.Path(file).parent / "mmcv_custom")
sys.path.insert(0, mmpose_path)
sys.path.insert(0, mmcv_custom_path)

Gradio-Blocks-Party org

FYI, ViTPose was recently added to transformers==4.48.0 https://github.com/huggingface/transformers/releases/tag/v4.48.0, so you can run it without mmcv, mmpose, etc.
Also, you can find a Space of the transformers version here.

Sign up or log in to comment