当前位置:   article > 正文

【YOLOV5之人脸识别/口罩检测】CPU+PyCharm+Anaconda运行_pycharm人脸识别 gpu

pycharm人脸识别 gpu

一. 创建新的环境并激活

  1. 打开Anaconda Prompt(miniconda3)
  2. 执行如下命令新建环境, 如下图显示:
conda create -n 新环境名称(例如:yolovTest) python=3.8
  • 1

在这里插入图片描述

  1. 激活新创建的环境

在这里插入图片描述

  1. 在activiate pytorch 命令后,依次输入命令(为了加快下载速度)
    (1) conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
    (2) conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
    (3) conda config --set show_channel_urls yes
    (4) conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
    开始下载包:conda install pytorch torchvision torchaudio cpuonly (去掉-c pytorch,表示从官网下载)
    7.Proceed时,选择y:表示同意下载
  2. 下载成功后的界面如下:
    在这里插入图片描述

二. 下载PyChram

  1. 下载链接:https://www.jetbrains.com/pycharm/download/#section=windows
  2. 下载执行文件
    在这里插入图片描述

三. 拉一份YOLOV5代码(有需要会上传到资料)

四. 在PyChram中的使用

  1. 打开文件夹
    File - Open - 选择文件夹
  2. 点击右下角Add New Interpreter - Add Local Interpreter - 选择好刚创建的环境
    在这里插入图片描述
  3. 点击OK
  4. 加入到下载任务队列
    在这里插入图片描述
  5. 安装pyqt5.
    在这里插入图片描述
  6. 安装成功
    在这里插入图片描述

附:我拉取的代码在运行时有错误,做了如下记录

  1. 运行window.py文件,报错信息:Process finished with exit code -1073740791 (0xC0000409)
    菜单栏 - Run
    在这里插入图片描述
    在这里插入图片描述
    运行成功:如下图弹出窗口。选择文件进行检测
    在这里插入图片描述

  2. 点击开始检测,终端报错为AttributeError: ‘Upsample’ object has no attribute ‘recompute_scale_factor’

在这里插入图片描述

  1. 解决办法如下:在这里插入图片描述
  2. 检测成功在这里插入图片描述
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小丑西瓜9/article/detail/729932
推荐阅读
相关标签
  

闽ICP备14008679号