一、pycharm导包的时候提示Unresolved reference
问题描述:在导入模块部分的时候出现了错误,写一个外部模块导入的时候居然提示unresolved reference,但是程序能正常运行没有什么问题,就是提示包部分下划线是红色,让人看着很不舒服,总感觉是不是程序出现错误了,下面给出了相应的解决方案
解决方案:选择工程文件的根目录(项目上) 单击右键 -> Mark Directory as,然后找到Sources Root,选中即可。
二、Downloading https://ultralytics.com/assets/Arial.ttf to …ubuntu18.4-YOLOv5报错[01]
问题描述:运行时会出该行,表示缺少Arial.ttf字体,需要下载,但因为网络问题无法下载时,会出现连接主机时间过长无响应的问题
解决方案:在文件yolov5/utils/plots.py中,以下代码中:
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'):
改为
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