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
GNU General Public License v3.0
670 stars 119 forks source link

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

Closed Tareq361 closed 2 years ago

Tareq361 commented 2 years ago

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 ?

Bobo-y commented 2 years ago

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

Tareq361 commented 2 years ago

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

Bobo-y commented 2 years ago

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:

Bobo-y commented 2 years ago

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.

Tareq361 commented 2 years ago

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.

Bobo-y commented 2 years ago

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

Tareq361 commented 2 years ago

Thanks man @Bobo-y