如何安装Detectron2

huangapple go评论65阅读模式
英文:

How to install Detectron2

问题

以下是翻译好的内容:

I am installing layout-parser and following this link. Did not face any issues with the following packages.

pip install layoutparser    
pip install "layoutparser[effdet]"    
pip install layoutparser torchvision    
pip install "layoutparser[paddledetection]"    
pip install "layoutparser[ocr]"

But I am not able to install detectron2

pip install "git+https://github.com/facebookresearch/detectron2.git@v0.5#egg=detectron2"

while installing this package I am getting this error

ERROR: Could not find a version that satisfies the requirement detectron2 (unavailable) (from versions: none)

ERROR: No matching distribution found for detectron2 (unavailable)

I followed the same installation guide in Google Colab and it worked but not able to install them in my Azure workspace.

英文:

I am installing layout-parser and following this link. Did not face any issues with the following packages.  

pip install layoutparser    
pip install "layoutparser[effdet]"    
pip install layoutparser torchvision     
pip install "layoutparser[paddledetection]"    
pip install "layoutparser[ocr]" 

But I am not able to install detectron2

pip install "git+https://github.com/facebookresearch/detectron2.git@v0.5#egg=detectron2" 

while installing this package I am getting this error    

> ERROR: Could not find a version that satisfies the requirement detectron2 (unavailable) (from versions: none)
>
> ERROR: No matching distribution found for detectron2 (unavailable)

I followed the same installation guide in Google collab and it worked but not able to install them in my Azure workspace.  

答案1

得分: 3

检查您的Python版本。如果您的Python版本为3.10或更高,您将遇到此问题。这是因为detectron2库只支持Python 3.9或更低版本。

英文:

Check your python version. If you have Python version as 3.10 or higher you will face this issue. This is because detectron2 library has only wheels for <= Python 3.9.

答案2

得分: 2

  • 打开终端或命令提示符。
  • 使用以下命令创建一个名为detectron2-env的新环境:
conda create --name detectron2-env python==3.9 -y
  • 使用以下命令激活环境:

Linux

conda activate detectron2-env

Windows

activate detectron2-env
  • 使用以下命令安装依赖项:
pip3 install torch torchvision torchaudio
git克隆https://github.com/facebookresearch/detectron2.git
python -m pip install -e detectron2

有关更多帮助,请参考以下文档:

https://detectron2.readthedocs.io/en/latest/tutorials/install.html

英文:

Open a terminal or command prompt.
Create a new environment called detectron2-env with the following command:

conda create --name detectron2-env python==3.9 -y

Activate the environment with the following command:

Linux

conda activate detectron2-env

Windows

activate detectron2-env

Install the dependencies with the following commands:

pip3 install torch torchvision torchaudio
git clone https://github.com/facebookresearch/detectron2.git
python -m pip install -e detectron2

For more help, please refer to the following documentation:

https://detectron2.readthedocs.io/en/latest/tutorials/install.html

huangapple
  • 本文由 发表于 2023年2月6日 14:19:11
  • 转载请务必保留本文链接:https://go.coder-hub.com/75357936.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定