环境介绍: ubantu16.04,pytorch,yolov5-v4
用yolov5训练自己的数据集!
1.
问题描述:gnutls_handshake() failed: The TLS connection was non-properly terminated.
subprocess.CalledProcessError: Command 'if [ -d .git ]; then git fetch && gi
错误定位:
if opt.global_rank in [-1, 0]:
check_git_status()
欠妥的办法:查了一些资料,未能找到有效解决方案,索性先不做检查,即注释掉这行代码
欠妥办法可能带来的影响:目前还不清楚
可以参考的东西:Git gnutls_handshake() failed解决办法 - 青山牧云人 - 博客园
2.
问题描述:yaml.scanner.ScannerError: while scanning a simple key in "data/coco.yaml", line 18, column 1 could not find expected ':' in "data/coco.yaml", line 20, column 1
错位定位:
data_dict = yaml.load(f, Loader=yaml.FullLoader)
错误原因:.yaml文件中的键和值没有用空格隔开,
解决方式:键和值之间添加空格,我这里是 nc:1,修改完之后是 nc: 1
3.
问题描述:Images sizes do not match. This will causes images to be display incorrectly in the UI.
4.
问题描述:UserWarning: Detected call of `lr_scheduler.step()` before `optimizer.step()`. In PyTorch 1.1.0 and later, you should call them in the opposite order: `optimizer.step()` before `lr_scheduler.step()`. Failure to do this will result in PyTorch skipping the first value of the learning rate schedule.
问题分析:UserWarning:检测到在'optimizer.step()'之前调用'lr_scheduler.step()'。在PyTorch 1.1.0及更高版本中,应该以相反的顺序调用它们:`optimizer.step()`在`lr_scheduler.step()之前。否则将导致PyTorch跳过学习率计划的第一个值。
解决方式:先调用optimizer.step() 再调用lr_scheduler.step()。
5.
问题描述:TypeError: int() can't convert non-string with explicit base
错误定位:
def color_list():
# Return first 10 plt colors as (r,g,b) https://stackoverflow.com/questions/51350872/python-from-color-name-to-rgb
def hex2rgb(h):
return tuple(int(h[1 + i:1 + i + 2], 16) for i in (0, 2, 4))
return [hex2rgb(h) for h in plt.rcParams['axes.prop_cycle'].by_key()['color']]
解决方式:把上述代码替换为
def color_list():
# Return first 10 plt colors as (r,g,b) https://stackoverflow.com/questions/51350872/python-from-color-name-to-rgb
def hex2rgb(h):
return tuple(int(h[1 + i:1 + i + 2], 16) for i in (0, 2, 4))
return [hex2rgb(h) for h in matplotlib.colors.TABLEAU_COLORS.values()]