当前位置:   article > 正文

yolov7中断训练后继续训练_yolov7断点续训命令

yolov7断点续训命令

1、训练指令

(1)--resume参数,参数值改为True

(2)weights参数,参数值改为中断前上次训练权重

中断后继续训练命令:

python.exe train.py --weights runs/train/exp9/weights/last.pt

2、报错:

TypeError: Descriptors cannot be created directly.
If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0.
If you cannot immediately regenerate your protos, some other possible workarounds are:
 1. Downgrade the protobuf package to 3.20.x or lower.
 2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).

处理:

看报错提示是protobuf这个库版本不对,protobuf需要3.20.x或以下版本,我查了下我自己的版本是4.15.2。版本不对,那就卸载原来的protobuf,再安装一个符号要求的版本

pip uninstall protoc

安装

pip install protobuf==3.19.0

 3、安装protobuf3.19.0后,又报错:

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
onnx 1.15.0 requires protobuf>=3.20.2, but you have protobuf 3.19.0 which is incompatible.
tensorflow-gpu 2.7.0rc0 requires numpy~=1.19.2, but you have numpy 1.22.4 which is incompatible.
Successfully installed protobuf-3.19.0

看报错提示还是版本不匹配,我安装了protobuf 3.19.0版本,但是需要3.20.2以上的版本

那就改成3.20.2版本。

卸载原来的protobuf

pip uninstall protobuf

安装protobuf3.20.2

pip install protobuf==3.20.2

4、protobuf版本问题搞定后,再次运行训练命令

python.exe train.py --weights runs/train/exp9/weights/last.pt

ok,接着之前中断的训练继续训练了

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小丑西瓜9/article/detail/124214
推荐阅读
相关标签
  

闽ICP备14008679号