yolov5 AssertionError: Image Not Found解决方案
运行yolov5 train.py报错:AssertionError: Image Not Found ../data/images/xxx.png
运行环境
一开始在笔记本上用显卡跑训练是可以正常运行的,后来随着数据量越来越大,笔记本显卡显存不够用了,改用学校的浪潮服务器来跑,但出现了报错。
报错详情
当时报错时忘记截图了,这里就大概描述一下报错发生的位置和内容。报错发生在终端输出接下来这句之后。
Optimizer groups: 62 .bias, 62 conv.weight, 59 other
train: Scanning 'data/train.cache' images and labels... 2590 found, 0 missing, 335 empty, 0 corrupted: 100%|##########| 2590/2590 [00:00<?, ?it/s]
在走完上面这个进度条之后就会出现如标题所示的报错。我这个项目在本地是可以跑通的,只是如果不减小batch-size会之后因为显存不足报错,可见图片训练集的位置没有问题,不会引起报错。
解决方案
在国内搜索引擎上似乎没有找到相关解决方案,在谷歌后在yolov5 github的issues里找到了可能的解决方案,链接在本文底部。其中有一位评论
I've opened PR #2042 to fix this issue. This runs an additional check on the actual image format using PIL img.format. For this check to actually run you'd need to delete your existing *.cache files in your dataset directories, which will trigger a new caching.
Verified update works correctly. I added a GIF to COCO128 and renamed it with a .jpg extension. The new check caught the file, removed it from the training images, and then trains correctly.
考虑到报错的位置本应该是要加载'data/val.cache'的,可能是这位提到的cache的问题,我试着将之前在本机训练生成的.cache文件删除,重新在服务器运行train.py
,顺利运行,开始训练。
如图,删除train.cache和val.cache后再重新在服务器上运行即可。
参考
https://github.com/ultralytics/yolov5/issues/195
最新文章
- C#自定义控件属性显示在属性面板中操作
- 游戏 gui button
- BZOJ2738: 矩阵乘法
- jxl 导入excel以及日期格式处理
- IOS 第三方开源库记录
- position containing block原点
- Cocos3.0测试版发布(中文)
- flume 以 kafka 为channel 的配置
- 【IE6的疯狂之四】IE6文字溢出BUG
- Unity相对于Cocos2d-x的比较
- 全面理解 javascript 的 argements caller callee call apply 之caller
- [模板]快速傅里叶变换(FFT)
- nginx反向代理proxy_pass的问题
- mysql报错:/usr/sbin/mysqld:unknown variable &#39;default-character-set=utf8&#39;
- 分享一个DataTable转List强类型的类库
- java_Proxy动态代理_AOP
- Eclipse 中安装Browse Deployment Location插件
- ural 2020 Traffic Jam in Flower Town(模拟)
- Redis学习记录(三)
- Ubuntu 12.04源