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

The package mmcv won't be able to install #58

Open
JiahaoYu1 opened this issue Mar 21, 2024 · 2 comments
Open

The package mmcv won't be able to install #58

JiahaoYu1 opened this issue Mar 21, 2024 · 2 comments

Comments

@JiahaoYu1
Copy link

Hello,

I'm a student on stage in Prof. Jeffery Cardille's lab at McGill, and we're trying to run this AI model on our own computer. When I was trying out the Flood Segmentation, the package mmcv is required, and I tried different ways to install the package but always get the error: Failed building wheel for mmcv, and here are my torch and cuda version:

!python -c 'import torch;print(torch.__version__);print(torch.version.cuda)'
2.2.1+cu121
12.1

and some approaches that I tried:
!pip install -U openmim

  1. !mim install mmcv==2.0.0 -f https://download.openmmlab.com/mmcv/dist/cu121/torch2.2.1/index.html

  2. !mim install mmcv-full

  3. !pip install mmcv==2.1.0 -f https://download.openmmlab.com/mmcv/dist/cu121/torch2.1/index.html

  4. git clone https://github.com/open-mmlab/mmcv.git
    cd mmcv
    pip install -r requirements/optional.txt
    MMCV_WITH_OPS=1 pip install -e .
    python .dev_scripts/check_installation.py

Thank you!

@melgor
Copy link

melgor commented Mar 22, 2024

I aslo was trying to run the model, but with the success. Here is my path:

conda create -n ibm python==3.10
conda activate ibm
pip3 install torch torchvision
pip install -U openmim
git clone https://github.com/NASA-IMPACT/hls-foundation-os.git
cd hls-foundation-os/
pip install -e .
mim install mmcv-full

Before running pip install -e . I changed setup.py from repo, exactly removed all versions of required python libraries, except mmsegmentation

from setuptools import setup

setup(
    name="geospatial_fm",
    version="0.1.0",
    description="MMSegmentation classes for geospatial-fm finetuning",
    author="Paolo Fraccaro, Carlos Gomes, Johannes Jakubik",
    packages=["geospatial_fm"],
    license="Apache 2",
    long_description=open("README.md").read(),
    install_requires=[
        "mmsegmentation @ git+https://github.com/open-mmlab/mmsegmentation.git@186572a3ce64ac9b6b37e66d58c76515000c3280",
        "rasterio",
        "rioxarray",
        "einops",
        "timm",
        "tensorboard",
        "imagecodecs",
        "yapf",
    ],
)

It was working like a charm!
Note: installing mmcv-full can take even 30 minutes!

@JiahaoYu1
Copy link
Author

JiahaoYu1 commented Mar 28, 2024

Hi,

Right now the mmcv installation part works for me, but I'm running into another issue where when I'm trying to run this line of code: finetuned_model = init_model(Config.fromfile(config_path), ckpt, device="cpu"), I'm getting errors like ImportError: cannot import name 'print_log' from 'mmcv' , and ImportError: Failed to import custom modules from {'imports': ['geospatial_fm']},

also: ImportError Traceback (most recent call last) [/usr/local/lib/python3.10/dist-packages/mmengine/utils/misc.py](https://localhost:8080/#) in import_modules_from_strings(imports, allow_failed_imports) 76 try: ---> 77 imported_tmp = import_module(imp) 78 except ImportError:

I'm assuming this is also related to the mmcv import issue? Thanks

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