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

Can not install in Colab #347

Open
pitikorn32 opened this issue Dec 25, 2023 · 7 comments
Open

Can not install in Colab #347

pitikorn32 opened this issue Dec 25, 2023 · 7 comments

Comments

@pitikorn32
Copy link

I have issue about install DinoV2 in Google Colab.

First, I want to run https://github.com/facebookresearch/dinov2/blob/main/notebooks/semantic_segmentation.ipynb in Colab.

import sys

INSTALL = True # Switch this to install dependencies
if INSTALL: # Try installing package with extras
    REPO_URL = "https://github.com/facebookresearch/dinov2"
    !{sys.executable} -m pip install -e {REPO_URL}'[extras]' --extra-index-url https://download.pytorch.org/whl/cu117  --extra-index-url https://pypi.nvidia.com
else:
    REPO_PATH = "<FIXME>" # Specify a local path to the repository (or use installed package instead)
    sys.path.append(REPO_PATH)

And I switched INSTALL = True to install but I found this

ERROR: https://github.com/facebookresearch/dinov2[extras] is not a valid editable requirement. It should either be a path to a local project or a VCS URL (beginning with bzr+http, bzr+https, bzr+ssh, bzr+sftp, bzr+ftp, bzr+lp, bzr+file, git+http, git+https, git+ssh, git+git, git+file, hg+file, hg+http, hg+https, hg+ssh, hg+static-http, svn+ssh, svn+http, svn+https, svn+svn, svn+file).

image

Then I tried another way follow this #219 (comment).
But still error while
pip install -r requirements.txt -r requirements-extras.txt

image

If someone can run semantic_segmentation in Colab help me please.

@thomasf1
Copy link

thomasf1 commented Feb 9, 2024

Getting the same error. Quite strange that nobody seems to have checked if the Colab version works :o - It´s usally the first thing people try and a good indication of a projects health.

@yassineyahyaoui
Copy link

yassineyahyaoui commented Mar 19, 2024

Same here. Have you found a workaround @thomasf1 @pitikorn32 ?

@thomasf1
Copy link

@yassineyahyaoui I have concluded that if they don't care about that, the rest will be a bit of a mess, too and moved on to use another project.

@JyotsanaS
Copy link

JyotsanaS commented Mar 22, 2024

Is there any other project for Dino v2? I am facing same error.

@yassineyahyaoui
Copy link

@JyotsanaS
Here are a few DinoV2 projects I've worked on that have worked for me using google colab:

  • Fine-tune a DinoV2 classifier: Click here
  • Fine-tune a DinoV2 classifier with and without Scheduler (benchmark): Click here
  • As for semantic segmentation, I've only managed to make it work locally. Here are the steps I followed: (reference)

First of all, make sure you have CUDA version 11.7
Next, you need to install the Microsoft C++ Build Tools. Here's a link that helped me
Now follow the instructions below

conda create -n myenv python=3.9 
conda activate myenv
install jupyter
conda install pytorch==2.0.0 torchvision==0.15.0 torchaudio==2.0.0 pytorch-cuda=11.7 -c pytorch -c nvidia
conda install pip
pip install fvcore
pip install iopath
pip install omegaconf
pip install xformers=0.0.18
pip install git+https://github.com/facebookincubator/submitit
pip install ftfy
pip install regex
pip install -U openmim
mim install mmcv==1.5.0
mim install mmsegmentation==0.27.0

That's how it worked for me, I hope it works for you too.

@yassineyahyaoui
Copy link

@thomasf1 @pitikorn32 @JyotsanaS I finally found a workaround that fixes Dinov2 Semantic Segmentation Notebook: Link

@ckevar
Copy link

ckevar commented Aug 2, 2024

I changed the section of the code as follows:

import sys

INSTALL = True # Switch this to install dependencies
if INSTALL: # Try installing package with extras
    REPO_URL = "https://github.com/facebookresearch/dinov2"
    !git clone {REPO_URL}
    %cd dinov2
    !{sys.executable} -m pip install -e . --extra-index-url https://download.pytorch.org/whl/cu117  --extra-index-url https://pypi.nvidia.com
    !{sys.executable} -m pip install -r requirements-extras.txt --extra-index-url https://download.pytorch.org/whl/cu117  --extra-index-url https://pypi.nvidia.com
else:
    REPO_PATH = "<FIXME>" # Specify a local path to the repository (or use installed package instead)
    sys.path.append(REPO_PATH)

Edit:
It might be an Error about "Failed to build installable wheels for some pyproject.toml based projects (mmcv-full)". So in order to install mmcv-full do this (in a separate section):

!pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cu118/torch2.1.0/index.html

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

5 participants