yolov5模型用的是github上YOLOv5官方的,
在autodl服务器上训练时,Arial.ttf字体会自动下载,但是无法下载。(当然在自己电脑上pycharm跑不会报这个错,可以下载)
解决方法:
class Annotator:
if RANK in (-1, 0):
check_font() # download TTF if necessary
# YOLOv5 Annotator for train/val mosaics and jpgs and detect/hub inference annotations
def __init__(self, im, line_width=None, font_size=None, font='Arial.ttf', pil=False, example='abc'):
将第3,4行注释掉,
改为:文章来源:https://www.toymoban.com/news/detail-515820.html
class Annotator:
#if RANK in (-1, 0):
#check_font() # download TTF if necessary
# YOLOv5 Annotator for train/val mosaics and jpgs and detect/hub inference annotations
def __init__(self, im, line_width=None, font_size=None, font='', pil=False, example='abc'):
重新训练即可正常训练。文章来源地址https://www.toymoban.com/news/detail-515820.html
到了这里,关于Downloading https://ultralytics.com/assets/Arial.ttf to ...... yolov5报错解决的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!