当前位置:网站首页>Detectron2 installation based on Anaconda under win10
Detectron2 installation based on Anaconda under win10
2022-07-24 00:20:00 【simple_ whu】
win10 Based on anaconda Of detectron2 install
stay Anaconda Create a virtual environment in
for example , I named the virtual environment I created mPytorch, Execute the following command to create this environment :
conda create -n mPytorch python=3.7
After creation , Use conda activate Statement to activate the environment . Which environment is currently activated , function conda install perhaps pip install The installed library exists in which environment . Activate mPytorch after , Run the official command to install pytorch and cudatoolkit.
conda activate mPytorch
conda install pytorch torchvision cudatoolkit=10.1 -c pytorch
install cuda Of C Language development package
Be careful , Previous section cudatoolkit Which version is installed , Go to NVIDIA's official website to download the corresponding version C Language cuda Development kit , And install . Its download and installation reference The website . Download Address .
When the download is complete , Double click the installation package , Accept the default installation options , Until installation is complete .
install MSVC compiler
If downloaded cuda10.x edition , You should install VS2019; If downloaded cuda11.x edition , You should install VS2022.
After installation , It should be found in the start menu x64 Native Tools Command Prompt for VS 2019 Command line entry :
Download and compile the installation detectron2
Although the official claim does not support windows Download and install , But the test is feasible .
stay GitHub download detectron2 And decompress , Or use git clone Command to copy the warehouse to the local ( If you install it Git for windows Words ).
The source code folder is shown in the figure :

According to the official tutorial , To compile and install detectron2, Just execute a command on the command line :
python -m pip install -e .\detectron2-main\
among -e Followed by the source folder path , It can be absolute path or relative path .
however ,windows I want to complete the compilation successfully , The following points need to be noted :
- Install a series of dependencies :
pip3 install easydict
conda install pyyaml
conda install cffi
conda install cython
conda install scipy
pip install pycocotools
- Open your
x64 Native Tools Command Prompt for VS 2019orx64 Native Tools Command Prompt for VS 2022, And enter theconda activate mPytorchActivate conda Environmental Science . - Set temporary environment variables
set DISTUTILS_USE_SDK=1
- Modify the source file
nms_rotated_cuda.cu:
opennms_rotated_cuda.cu, Use the framed part in the following figure at the beginning of the line ’//' Just comment it out . This is to solve the error messagenms_rotated_cuda.cu(68): error: identifier "single_box_iou_rotated" is undefined, You can also refer to This blog .
- function python -m pip install -e .\detectron2-main\ Compile and install .
Test use detectron2
Need to install opencv.
pip install opencv-python
According to the official example , Download a trained model ,model_final_280758.pkl, And put it in detectron2 Source code demo Under the folder .
Then enter on the command line demo Folder , Run the command :
python .\demo.py --config-file ..\configs\COCO-Detection\faster_rcnn_R_50_FPN_3x.yaml --input Your input picture name --opts MODEL.WEIGHTS model_final_280758.pkl

边栏推荐
- GBase 8c 访问权限访问函数(四)
- 进步成长的快乐
- Inode, soft link, hard link
- Single target tracking - [correlation filtering] mosse:visual object tracking using adaptive correlation filters
- Structured streaming programming model (input table, result table, output mode...)
- 今天在家里补觉
- GBase 8c 会话信息函数(四)
- 【低代码】低代码发展的局限性
- Happiness of progress and growth
- Gbase 8C access authority query function (I)
猜你喜欢

Mobile terminal H5 - a lifeline timeline

Jenkins uses sonarqube to build pipeline code review project

English语法_指示代词 - So

【译】Go RPC 入门:Hello World

Redis master-slave synchronization mechanism

高数_第1章空间解析几何与向量代数__两点距

Sum of submatrix

加密技术应用

Simple implementation and analysis of binary search tree

JMeter中的自动转义处理
随机推荐
Codeforces Round #807 (Div. 2)(A-D)
数据模型设计方法概述
PHP implements stripe subscription
Mysql database foundation
Redis cluster hash sharding algorithm (slot location algorithm)
Xmind用例导入到TAPD的方案(附代码)
GBase 8c 访问权限查询函数(二)
【低代码】低代码发展的局限性
YOLOv1
高数_第1章空间解析几何与向量代数__两点距
Tencent will close the "magic core". Is there any resistance to the development of digital collections?
GBase 8c 二进制字符串操作符
加密技术应用
NGFW portal authentication experiment
进步成长的快乐
Gbase 8C system table information function (II)
[attack and defense world web] difficulty five-star 15 point advanced question: bug
Understanding polymorphism and letting different "people" do the same thing will produce different results
Comparison of the shortcomings of redis master-slave, sentinel and cluster architectures
Gbase 8C access authority query function (6)