接引前文《Windows 10 yolov5 GPU环境》,配置完成之后,一度因为虚拟内存没什么太大用处。原有设置的虚拟内存c盘(系统盘)为4096-8192。在我将虚拟内存改成1024-2048之后,然后tm报错了。就是上面的的这个错误:RuntimeError: Unable to find a valid cuDNN algorithm to run convolution。但是实际上,错误和cuda没有直接关系,目前我还不太清楚为什么虚拟内存直接关系到了cuda的运行环境,或者说pytorch的运行环境。网上搜了一下也没找到相关的资料,主要应该是我的理解太浅显。
yolov5 训练速度对比
测试训练集二十几张图片,在m1 mac上的运行时间一共8.084 小时,共152 epochs。对于这个计算速度还是比较让人吃惊的,这个效率也太低了。对于需要处理图像的训练这个速度也无法让人接受。
152 epochs completed in 8.084 hours. Optimizer stripped from runs/train/exp3/weights/last.pt, 14.4MB Optimizer stripped from runs/train/exp3/weights/best.pt, 14.4MB wandb: Waiting for W&B process to finish, PID 63332 wandb: Program ended successfully. wandb: Find user logs for this run at: /Users/zhongming/PycharmProjects/yolov5/wandb/offline-run-20210913_191626-18h6dxo0/logs/debug.log wandb: Find internal logs for this run at: /Users/zhongming/PycharmProjects/yolov5/wandb/offline-run-20210913_191626-18h6dxo0/logs/debug-
Windows 10 yolov5 GPU环境
网上关于yolov5 gpu环境搭建的文章也是一抓一大把,但是实际上好用不好用并不清楚。所以要想按照那些所谓的教程安装配置,很可能会失败。当然按照我的文章进行安装配置也可能会失败。逼乎上有个帖子问新手学习一门语言该不该用ide,还有一大群人建议新手配置各种环境,用sb vim等编辑器,配置各种执行路径,各种源代码路径、库路径。这tm一个ide就解决的问题,非得折腾半天,这是为了让没入门的赶紧放弃?
我简单的说一下我的安装流程:
1.下载cuda安装文件,https://developer.nvidia.com/cuda-downloads?target_os=Windows&target_arch=x86_64&target_version=10&target_type=exe_network 安装cuda,默认一路next 即可。
2.安装pytorch-gpu,yolov5的运行环境主要依赖于pytorch。通过官网https://pytorch.org可以找到对应的安装命令:
Android Skip Ads Yolov5 Project
YOLOv5 🚀 is a family of object detection architectures and models pretrained on the COCO dataset, and represents Ultralytics open-source research into future vision AI methods, incorporating lessons learned and best practices evolved over thousands of hours of research and development.
1. 环境搭建
自动广告跳过这个想法,不过由于各种原因一直没有实时。知道最近才又重新开始折腾这个东西,yolov5的安装这里就不再说明了,建议使用anaconda安装。我创建了一个conda环境可以直接下载之后通过conda安装:
# 1. conda 环境地址:https://anaconda.org/obaby/yolov5 # 2. 下载对应操作系统的环境yml脚本 # 3. 在Terminal 或者 an Anaconda Prompt内执行 conda env create user/my-environment source activate my-environment
如果不想使用上面的安装方法可以参考:https://blog.csdn.net/oJiWuXuan/article/details/107558286 和https://github.com/ultralytics/yolov5 按照官方指导进行安装。
秀人集爬虫
功能:支持全站爬取,搜索爬取。想下载什么内容自己定制,目前版本不支持独立页面下载,后续可能会考虑支持,目前我的目标是为了爬取整个网站,所以单页面下载功能不一定会做,即使做了也不一定什么时候会上。 参数说明:
xiurenji.exe 可执行文件名称 帮助: -h 显示帮助说明 必选参数: -a 整站爬取 -q 搜索爬取,针对关键字搜索之后对于搜索结果页进行爬取 可选参数: -p 制定下载目录,默认下载路径为当前exe所在目录下的images文件夹
Python3 requests 下载进度条
代码:
def proxy_get_content_stream(url): if is_use_proxy: socks.set_default_proxy(socks.SOCKS5, PROXY_HOST, PROXY_PORT) socket.socket = socks.socksocket return requests.get(url, headers=HEADERS, stream=True, timeout=300) def save_image_from_url_with_progress(url, cnt): with closing(proxy_get_content_stream(url)) as response: chunk_size = 1024 # 单次请求最大值 content_size = int(response.headers['content-length']) # 内容体总大小 data_count = 0 with open(cnt, "wb") as file: for data in response.iter_content(chunk_size=chunk_size): file.write(data) data_count = data_count + len(data) now_position = (data_count / content_size) * 100 print("\r[D] 下载进度: %s %d%%(%d/%d)" % (int(now_position) * '▊' + (100 - int(now_position)) * ' ', now_position, data_count, content_size,), end=" ") print('')
美图录 爬虫
**************************************************************************************************** _ _ ____ ___ | |__ __ _| |__ _ _ / __ \ _ __ ___ __ _ _ __ ___ / _ \| '_ \ / _` | '_ \| | | |/ / _` | '_ ` _ \ / _` | '__/ __| | (_) | |_) | (_| | |_) | |_| | | (_| | | | | | | (_| | | \__ \ \___/|_.__/ \__,_|_.__/ \__, |\ \__,_|_| |_| |_|\__,_|_| |___/ |___/ \____/ 美图录爬虫 Verson: 21.6.15 Blog: http://www.h4ck.org.cn **************************************************************************************************** **************************************************************************************************** [*] 2021-06-16 21:00:11 CAT: 开始分析分类信息...... [*] 2021-06-16 21:00:11 泳装: http://www.meitulu.cn/t/yongzhuang/ [*] 2021-06-16 21:00:11 可爱: http://www.meitulu.cn/t/keai/ [*] 2021-06-16 21:00:11 日本美女: http://www.meitulu.cn/t/ribenmeinv/