当前位置:网站首页>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

边栏推荐
- Redis cluster hash sharding algorithm (slot location algorithm)
- 加密技术应用
- Redis数据结构
- kubernetes error
- GBase 8c 字符串操作符
- 进步成长的快乐
- A lot of happiness in learning
- The name in Qiankun subapplication package.json becomes the default path
- 【Android Kotlin】Property、Getter 和 Setter
- Simple implementation and analysis of binary search tree
猜你喜欢

Pipeline pipeline project is built by declarative and jenkinsfile under Jenkins

vulnhub wpwn: 1

Comparison of the shortcomings of redis master-slave, sentinel and cluster architectures

2022年7月23日——mapper文件说明

Codeforces Round #807 (Div. 2)(A-D)

The differences between text and image drawing, data storage, localstorage, sessionstorage, and cookies

分布式之 CAP 原则
![[translation] Introduction to go RPC: Hello World](/img/dd/7887f056bc031fe50253078dd355d0.png)
[translation] Introduction to go RPC: Hello World

Xmind用例导入到TAPD的方案(附代码)

YOLOv1
随机推荐
Automatic escape processing in JMeter
Single target tracking - [correlation filtering] mosse:visual object tracking using adaptive correlation filters
docker 拉取redis镜像 并运行
GBase 8c系统表信息函数(三)
[Android kotlin] property, getter and setter
学习的快乐很多
iNFTnews | 呵护“雪山精灵”,42VERSE“数字生态保护”公益项目即将盛启
Sed in-depth understanding and use
English grammar_ Demonstrative pronoun -such / the same
After openfeign sets circuitbreaker=true, feign's readtimeout expires
[attack and defense world web] difficulty five-star 15 point advanced question: bug
如何提升数据质量
FPGA——SPI总线控制flash(3)含代码
The differences between text and image drawing, data storage, localstorage, sessionstorage, and cookies
Esp8266 - at command + network transparent transmission
Redis数据结构
GBase 8c模式可见性查询函数(二)
Pytest interface automation testing framework | multi process running case
【低代码】低代码发展的局限性
IT基础英语