Nanodet 轻量级模型在anaconda环境下的配置教程
nanodet简介
轻量级模型,模型大小只有1.8M,适合移动端和嵌入式开发
nanodet github地址
一 准备环境
- 1.下载anaconda选择合适的版本,本文中使用winx64
anaconda官网地址 - 2.配置对应cuda和cudnn(本文中pytorch用gpu,如果用cpu可以略过)
上
CUDA官网下载CUDA10.2版本及其补丁
cuDNN官网 - 3.用git将官网代码下载到本地
git clone --recursive https://github.com/RangiLyu/nanodet.git
二 anaconda中创建环境和配置
1. 打开conda的命令行界面
2. 创建和配置环境
conda create nanodet
在conda中配置一个nanodet的虚拟环境
conda activate nanodet
在conda中激活nanodet虚拟环境
3.cd到下载的nanodet路径下
pip install requirements.txt
如果出现timeout报错,可以尝试换一个pip源 ,加-i即可
例如:pip install numpy -i https://pypi.tuna.tsinghua.edu.cn/simple
国内常用镜像源
清华:https://pypi.tuna.tsinghua.edu.cn/simple
阿里云:http://mirrors.aliyun.com/pypi/simple/
中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/
华中理工大学:http://pypi.hustunique.com/
山东理工大学:http://pypi.sdutlinux.org/
豆瓣:https://pypi.douban.com/simple/
三 测试模型
demo/demo.py image --config D:/project/nanodet/config/nanodet-m.yml --model D:/project/nanodet/workspace/nanodet_m.pth --path D:\database --save_result
将测试的图片放到 D:\database路径下并在本路径下批量生成验证结果