Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MMCV instalation loophole between MMCV 1.7.2 and MMCV 2.0.0rc4 #151

Open
CrisTTT opened this issue Oct 16, 2024 · 10 comments
Open

MMCV instalation loophole between MMCV 1.7.2 and MMCV 2.0.0rc4 #151

CrisTTT opened this issue Oct 16, 2024 · 10 comments

Comments

@CrisTTT
Copy link

CrisTTT commented Oct 16, 2024

Hi everyone.

In trying to run ViTPose according to the instalation and running instructions, I keep banging my head against the same error again and again no matter the environment i use. The issue is the following:
... line 16, in
assert (mmcv_version >= digit_version(mmcv_minimum_version)
AssertionError: MMCV==1.7.2 is used but incompatible. Please install mmcv>=2.0.0rc4, <=3.0.0.

OR:

.local/lib/python3.10/site-packages/mmpose/init.py", line 10, in
mmcv_version = digit_version(mmcv.version)
AttributeError: module 'mmcv' has no attribute 'version'

Currently I am running a WSL Ubuntu 22.04 in Pycharm, I also tried with the normal pycharm venv. Python 3.8 (I also tried 3.7) cuda 11.8, torch 2.1.0 +cu118 torchvision 0.16.0+cu118

I believe there might be something wrong with the mmpose mmcv/mmcv-full versioning/naming?

@ErikValle2
Copy link

Check this: #150

@CrisTTT
Copy link
Author

CrisTTT commented Oct 16, 2024

Thank you for the indication, I understand I should run that docker image to have the complete correct versions of everything in order to run ViTPose, correct?

@ErikValle2
Copy link

Yes. At least it will let you run demos included in this repository. I tried 2d_human_pose_demo.md and it works! However, you must update paths before running any script.

@CrisTTT
Copy link
Author

CrisTTT commented Oct 17, 2024

I keep running into this error both on the WSL2 (ubuntu 22.04) and on the venv.

=> ERROR [ 2/11] RUN apt-get update && apt-get install -y git ninja-build libglib2.0-0 libsm6 libxrender-dev libxext6 libgl1-mesa-glx && apt-get clean 3.8s

[ 2/11] RUN apt-get update && apt-get install -y git ninja-build libglib2.0-0 libsm6 libxrender-dev libxext6 libgl1-mesa-glx && apt-get clean && rm -rf /var/lib/apt/lists/*:
...
0.398 The following signatures couldn't be verified because the public key is not available: NO_PUBKEY A4B469963BF863CC
...
2.823 Reading package lists...
3.704 W: GPG error: https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64 InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY A4B469963BF863CC
3.704 E: The repository 'https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64 InRelease' is not signed.


Dockerfile:11

10 |
11 | >>> RUN apt-get update && apt-get install -y git ninja-build libglib2.0-0 libsm6 libxrender-dev libxext6 libgl1-mesa-glx
12 | >>> && apt-get clean
13 | >>> && rm -rf /var/lib/apt/lists/*
14 |

ERROR: failed to solve: process "/bin/sh -c apt-get update && apt-get install -y git ninja-build libglib2.0-0 libsm6 libxrender-dev libxext6 libgl1-mesa-glx && apt-get clean && rm -rf /var/lib/apt/lists/*" did not complete successfully: exit code: 100

Got any clue how i might be able to fix this?

@ErikValle2
Copy link

Did you try this: #27? If works, please let me know and I can update the Dockerfile accordingly.

@CrisTTT
Copy link
Author

CrisTTT commented Oct 17, 2024

I applied the fix in #27, the docker installed successfully but when running the test command inside the container I got the following:

root@782227951ba0:/mmpose# python demo/topdown_demo_with_mmdet.py demo/mmdetection_cfg/faster_rcnn_r50_fpn_coco.py https://download.openmmlab.com/mmdetection/v2.0/fa
ster_rcnn/faster_rcnn_r50_fpn_1x_coco/faster_rcnn_r50_fpn_1x_coco_20200130-047c8118.pth configs/body_2d_keypoint/topdown_heatmap/coco/td-hm_hrnet-w48_8xb32-210e_coco
-256x192.py https://download.openmmlab.com/mmpose/top_down/hrnet/hrnet_w48_coco_256x192-b9e0b3ab_20200708.pth --input demo/resources/demo.mp4 --output-root vis_results
Traceback (most recent call last):
File "demo/topdown_demo_with_mmdet.py", line 11, in
import mmengine
ModuleNotFoundError: No module named 'mmengine'
root@782227951ba0:/mmpose#

By pip installing mmengine inside the docker, the mmcv version got broken again.

@ErikValle2
Copy link

Yes, now I remember I had to fix it manually. Just give me a few minutes and I will update my PR.

@ErikValle2
Copy link

This is working fine from my side

ARG PYTORCH="1.12.1"
ARG CUDA="11.3"
ARG CUDNN="8"

FROM pytorch/pytorch:${PYTORCH}-cuda${CUDA}-cudnn${CUDNN}-devel

ENV TORCH_CUDA_ARCH_LIST="6.0 6.1 7.0+PTX"
ENV TORCH_NVCC_FLAGS="-Xfatbin -compress-all"
ENV CMAKE_PREFIX_PATH="$(dirname $(which conda))/../"

RUN rm /etc/apt/sources.list.d/cuda.list

RUN apt-get update && apt-get install -y git ninja-build libglib2.0-0 libsm6 libxrender-dev libxext6 libgl1-mesa-glx\
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/*

# Install xtcocotools
RUN pip install cython
RUN pip install xtcocotools

# Install MMCV
RUN pip install mmcv==2.0.1 -f https://download.openmmlab.com/mmcv/dist/cu113/torch1.12/index.html

# Install MMDet
RUN pip install mmdet mmengine

# Install MMPose
RUN conda clean --all
RUN git clone https://github.com/open-mmlab/mmpose.git /mmpose
WORKDIR /mmpose
RUN mkdir -p /mmpose/data
ENV FORCE_CUDA="1"
RUN pip install -r requirements/build.txt
RUN pip install --no-cache-dir -e .

To run it, just type:

docker build -t vitpose .
docker run -it --name vitpose_test -v $HOME/volume:/volume --gpus all vitpose:latest
python demo/topdown_demo_with_mmdet.py demo/mmdetection_cfg/faster_rcnn_r50_fpn_coco.py https://download.openmmlab.com/mmdetection/v2.0/faster_rcnn/faster_rcnn_r50_fpn_1x_coco/faster_rcnn_r50_fpn_1x_coco_20200130-047c8118.pth configs/body_2d_keypoint/topdown_heatmap/coco/td-hm_hrnet-w48_8xb32-210e_coco-256x192.py https://download.openmmlab.com/mmpose/top_down/hrnet/hrnet_w48_coco_256x192-b9e0b3ab_20200708.pth --input /volume/YOUR_VIDEO.avi --output-root vis_results --save-predictions

Do not forget to mount a volume with a video to test it!

@CrisTTT
Copy link
Author

CrisTTT commented Oct 17, 2024

I will give it a try in a couple of hours and let you know of the result, thank you!

@CrisTTT
Copy link
Author

CrisTTT commented Oct 19, 2024

The version above gave an error, unfortunately I forgot to keep the log, changed it to the following:
ARG PYTORCH="1.12.1"
ARG CUDA="11.3"
ARG CUDNN="8"

FROM pytorch/pytorch:${PYTORCH}-cuda${CUDA}-cudnn${CUDNN}-devel

Set environment variables

ENV TORCH_CUDA_ARCH_LIST="6.0 6.1 7.0+PTX"
ENV TORCH_NVCC_FLAGS="-Xfatbin -compress-all"
ENV CMAKE_PREFIX_PATH="$(dirname $(which conda))/../"

RUN rm /etc/apt/sources.list.d/cuda.list

Install necessary packages

RUN apt-get update &&
apt-get install -y
perl
git
ninja-build
libglib2.0-0
libsm6
libxrender-dev
libxext6
libgl1-mesa-glx
libssl1.0.0
--fix-missing &&
apt-get clean &&
rm -rf /var/lib/apt/lists/*

Fix broken dependencies (if any)

RUN apt-get update && apt-get install -f && apt-get clean

Install xtcocotools

RUN pip install cython
RUN pip install xtcocotools

Install MMCV from PyPI (Adjust Version Accordingly)

RUN pip install mmcv==2.0.0

Install MMDet

RUN pip install mmdet mmengine

Clone and set up MMPose

RUN conda clean --all
RUN git clone https://github.com/open-mmlab/mmpose.git /mmpose
WORKDIR /mmpose
RUN mkdir -p /mmpose/data
ENV FORCE_CUDA="1"

Install dependencies for MMPose

RUN pip install -r requirements/build.txt
RUN pip install --no-cache-dir -e .

After creating this docker, I tried running the python demo/topdown ... But I got an error related to nms. When checking the cuda versions nvcc gave 11.3 smi gave 12.x.

I decided to abandon the docker idea and go for installing it "manually" to not only build the demo but also be able to fine tune.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants