Angelica Mhay Salazar
Angelica Mhay Salazar

Reputation: 39

Cant get the right yolor pre trained weights in YOLOR

I'm training a custom dataset in yolor. I successfully run its once but after some time, I cant manage to do it very well.

The first error I noticed is in the training part:

Traceback (most recent call last):   File "train.py", line 537, in <module>
    train(hyp, opt, device, tb_writer, wandb)   File "train.py", line 80, in train
    ckpt = torch.load(weights, map_location=device)  # load checkpoint   File "/usr/local/lib/python3.7/dist-packages/torch/serialization.py", line 595, in load
    return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)   File "/usr/local/lib/python3.7/dist-packages/torch/serialization.py", line 764, in _legacy_load
    magic_number = pickle_module.load(f, **pickle_load_args)
_pickle.UnpicklingError: invalid load key, '<'.

then i traced it and found that the pre trained weights didnt load correctly with this code:

%cd /content/yolor
!bash scripts/get_pretrain.sh

ann give me this error:

/content/yolor
awk: cannot open ./cookie (No such file or directory)

rm: cannot remove './cookie': No such file or directory

and that's the first and main thing I noticed comparing to what I've done, it should load the weight in there.

its just giving me a pre-trained files with some HTML code.

im using goolge colab btw

Upvotes: 3

Views: 981

Answers (2)

Praneeth kumar
Praneeth kumar

Reputation: 9

As mentioned above, you can download the pre-train yolo representation weights file from the yolor_p6.pt: https://drive.google.com/uc?export=download&id=1Tdn3yqpZ79X7R1Ql0zNlNScB1Dv9Fp76 yolor_w6.pt: https://drive.google.com/uc?export=download&id=1UflcHlN5ERPdhahMivQYCbWWw7d2wY7U because the server is not working properly (I guess) so it couldn't download the data from the following links, so you just go the above links and download the weights manually and upload the two files in drive in yoloR folder(if you are working in colab)

Upvotes: 1

Hamdi Tarek
Hamdi Tarek

Reputation: 141

For me, the easiest way was to download data on my laptop, then upload them and replace current HTML weights with the correct ones. You will find two weights link to google drive in the get_pretrain.sh file

yolor_p6.pt: https://drive.google.com/uc?export=download&id=1Tdn3yqpZ79X7R1Ql0zNlNScB1Dv9Fp76 yolor_w6.pt: https://drive.google.com/uc?export=download&id=1UflcHlN5ERPdhahMivQYCbWWw7d2wY7U

curl -c ./cookie -s -L "https://drive.google.com/uc?export=download&id=1Tdn3yqpZ79X7R1Ql0zNlNScB1Dv9Fp76" > /dev/null curl -Lb ./cookie "https://drive.google.com/uc?export=download&confirm=awk '/download/ {print $NF}' ./cookie&id=1Tdn3yqpZ79X7R1Ql0zNlNScB1Dv9Fp76" -o yolor_p6.pt rm ./cookie

curl -c ./cookie -s -L "https://drive.google.com/uc?export=download&id=1UflcHlN5ERPdhahMivQYCbWWw7d2wY7U" > /dev/null curl -Lb ./cookie "https://drive.google.com/uc?export=download&confirm=awk '/download/ {print $NF}' ./cookie&id=1UflcHlN5ERPdhahMivQYCbWWw7d2wY7U" -o yolor_w6.pt rm ./cookie

I am not familiar with colab, that's why I used this simple solution.

Upvotes: 1

Related Questions