Bobo-y / flexible-yolov5

More readable and flexible yolov5 with more backbone(gcn, resnet, shufflenet, moblienet, efficientnet, hrnet, swin-transformer, etc) and (cbam,dcn and so on), and tensorrt

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TypeError: load() missing 1 required positional argument: 'Loader'

Tareq361 opened this issue · comments

commented

When training I got this error:
model_config = yaml.load(open(model_config, 'r'))
TypeError: load() missing 1 required positional argument: 'Loader'

What is the problem @Bobo-y ?

commented

@Tareq361 this code use PyYAML 5.3.1, for PyYaml 6 + , you can write
yaml.load(open(model_config, 'r'), yaml. SafeLoader)

commented

Thanks, man, @Bobo-y
How can I use other versions of yolov5? like yolov5x
Can I use the --weights yolov5x.pt in train.py?

commented

Thanks, man, @Bobo-y How can I use other versions of yolov5? like yolov5x

change version in configs/model_yolo.yal, like yolov5x, set version : x

backbone: type: YOLOv5 version: x # x, m, l ,x with_C3TR: False head: nc: 1 stride: [8.0, 16.0, 32.0] anchors: - [10,13, 16,30, 33,23] # P3/8 - [30,61, 62,45, 59,119] # P4/16 - [116,90, 156,198, 373,326] # P5/32

commented

Thanks, man, @Bobo-y How can I use other versions of yolov5? like yolov5x Can I use the --weights yolov5x.pt in train.py?

for this repo, You cannot directly use the pretrained weights of the ultralytics/yolov5 ,because the parameters name changed, If you must use it, you need to match the parameter name yourself.

commented

Yeah, got it

Thanks, man, @Bobo-y How can I use other versions of yolov5? like yolov5x Can I use the --weights yolov5x.pt in train.py?

for this repo, You cannot directly use the pretrained weights of the ultralytics/yolov5 ,because the parameters name changed, If you must use it, you need to match the parameter name yourself.

Got it, but it's slower than the normal yolov5s training, I am training in google colab.

commented

Yeah, got it

Thanks, man, @Bobo-y How can I use other versions of yolov5? like yolov5x Can I use the --weights yolov5x.pt in train.py?

for this repo, You cannot directly use the pretrained weights of the ultralytics/yolov5 ,because the parameters name changed, If you must use it, you need to match the parameter name yourself.

Got it, but it's slower than the normal yolov5s training, I am training in google colab.

ohh~, i'll check it

commented

Thanks man @Bobo-y