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 &quot;train.py&quot;, line 537, in &lt;module&gt;
    train(hyp, opt, device, tb_writer, wandb)   File &quot;train.py&quot;, line 80, in train
    ckpt = torch.load(weights, map_location=device)  # load checkpoint   File &quot;/usr/local/lib/python3.7/dist-packages/torch/serialization.py&quot;, line 595, in load
    return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)   File &quot;/usr/local/lib/python3.7/dist-packages/torch/serialization.py&quot;, line 764, in _legacy_load
    magic_number = pickle_module.load(f, **pickle_load_args)
_pickle.UnpicklingError: invalid load key, '&lt;'.

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

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&amp;id=1Tdn3yqpZ79X7R1Ql0zNlNScB1Dv9Fp76
yolor_w6.pt: https://drive.google.com/uc?export=download&amp;id=1UflcHlN5ERPdhahMivQYCbWWw7d2wY7U
curl -c ./cookie -s -L &quot;https://drive.google.com/uc?export=download&amp;id=1Tdn3yqpZ79X7R1Ql0zNlNScB1Dv9Fp76&quot; &gt; /dev/null
curl -Lb ./cookie &quot;https://drive.google.com/uc?export=download&amp;confirm=awk '/download/ {print $NF}' ./cookie&amp;id=1Tdn3yqpZ79X7R1Ql0zNlNScB1Dv9Fp76&quot; -o yolor_p6.pt
rm ./cookie
curl -c ./cookie -s -L &quot;https://drive.google.com/uc?export=download&amp;id=1UflcHlN5ERPdhahMivQYCbWWw7d2wY7U&quot; &gt; /dev/null
curl -Lb ./cookie &quot;https://drive.google.com/uc?export=download&amp;confirm=awk '/download/ {print $NF}' ./cookie&amp;id=1UflcHlN5ERPdhahMivQYCbWWw7d2wY7U&quot; -o yolor_w6.pt
rm ./cookie
I am not familiar with colab, that's why I used this simple solution.
