当前位置:网站首页>[pytorch environment installation]
[pytorch environment installation]
2022-06-13 09:32:00 【LYpokerface】
pytorch install , Simple record
1. Get ready Anaconda Environmental Science , Download from the official website
conda After installation ,cmd It can be done directly conda Command operation
2. Environment configuration
(1) The environment name is paddle ,python Version is 3.9, Subsequent deep learning operations are carried out in this environment
conda create -n pytorch python=3.9
(2) Enter the designated environment
conda activate pytorch
(3)pytorch Get the official website according to your own configuration conda Download instructions ,pytorch Download from the official website 
For example, I downloaded cpu edition , It is recommended to use pip download , use conda because pytorch Servers are slow in foreign countries ,conda Download , hold -c The suffix of is deleted. It is faster to use the image source
pip3 install torch torchvision torchaudio
(4) After installation , Verify that the environment is installed successfully
import torch
a = torch.cuda.is_available()
print(a)
Activate the environment - Get into python Interpreter - load torch library , In fact, the installation was successful without any exception
3. download yolov5 Source code , stay github Direct download
pycharm Similarly, you can download it from the official website ,Pycharm , use pycharm Open the download paddledetection Engineering documents , Select corresponding python Interpreter File-Setting-Project-python interpreter choice conda Inside pytorch In the environment python.exe Interpreter .
After downloading, there are... In the directory requirements.txt, For installation python Other dependent Libraries , stay cmd perhaps pycharm Install under the console , My subsequent console operations are in pycharm perform , It's more convenient .
pip install -r requirements.txt
4. test pytorch-yolov5 The environment is set up
yolov5s.pt Is a model weight file , If not, you need to download
python detect.py --source data/images/bus.jpg --weights pretrained/yolov5s.pt

边栏推荐
- Classes and objects - initialization and cleanup of objects
- (Dijkstra + shortest circuit + by point n^2) acwing 849 Dijkstra finding the shortest path I
- Delete soft link
- Class and object -- friend
- BGP 联邦+Community
- I set up a blog
- JS【中高级】部分的知识点我帮你们总结好了
- LeetCode 6098. 统计得分小于 K 的子数组数目(前缀和+二分查找)
- C language: recursive function to realize Hanoi Tower
- Collection of articles on virtualization and cloud computing
猜你喜欢

(dfs+ tree DP) acwing 846 Center of gravity of tree

Longadder of the source code of JUC atomic accumulator

【pytorch环境安装搭建】

(bfs) acwing 847. Hierarchy of points in the graph

C language: dynamic memory management

acwing 788. Number of pairs in reverse order

202012 CCF test questions

(state compression dp+ binary) acwing 91 Shortest Hamilton path

(tree DP) acwing 285 A dance without a boss

Can the operation of the new BMW I3 meet the expectations of the famous products of the 3 series?
随机推荐
线上调试工具Arthas基础
QML(06)——qml. Add a new folder under QRC
SpEL表达式 简单使用
Batch read all voice files under the folder
C language 7-13 day K candle chart (15 points)
Timestamp to localdate
JUC field Updater
C language: five custom types
LeetCode 6095. Strong password checker II
Exercise 7-10 finding specified characters (15 points)
阿里高级专家剖析 | Protocol的标准设计
C language: deep understanding of character functions and string functions (2)
C language: Address Book
ROS2之OpenCV人脸识别foxy~galactic~humble
C language: sanziqi
Yolov5 face video stream
@Value does not take effect and extend/implement other classes cannot inject beans manually
JUC Unsafe
C/s model and P2P model
Final principle