WongKinYiu / yolor

implementation of paper - You Only Learn One Representation: Unified Network for Multiple Tasks (https://arxiv.org/abs/2105.04206)
GNU General Public License v3.0
1.99k stars 517 forks source link

How to download the pretrained weights ? #219

Closed Aayush-Jain01 closed 2 years ago

Aayush-Jain01 commented 2 years ago

On running

cd /yolor
bash scripts/get_pretrain.sh

The .pt file cannot be downloaded due to a google drive warning and instead of the weights it is an html file of the warning

<!DOCTYPE html><html><head><title>Google Drive - Virus scan warning</title><meta http-equiv="content-type" content="text/html; charset=utf-8"/><style nonce="dRFVskmataaNG/kovcRLZg">/* Copyright 2022 Google Inc. All Rights Reserved. */
.goog-inline-block{position:relative;display:-moz-inline-box;display:inline-block}* html .goog-inline-block{display:inline}*:first-child+html .goog-inline-block{display:inline}.goog-link-button{position:relative;color:#15c;text-decoration:underline;cursor:pointer}.goog-link-button-disabled{color:#ccc;text-decoration:none;cursor:default}body{color:#222;font:normal 13px/1.4 arial,sans-serif;margin:0}.grecaptcha-badge{visibility:hidden}.uc-main{padding-top:50px;text-align:center}#uc-dl-icon{display:inline-block;margin-top:16px;padding-right:1em;vertical-align:top}#uc-text{display:inline-block;max-width:68ex;text-align:left}.uc-error-caption,.uc-warning-caption{color:#222;font-size:16px}#uc-download-link{text-decoration:none}.uc-name-size a{color:#15c;text-decoration:none}.uc-name-size a:visited{color:#61c;text-decoration:none}.uc-name-size a:active{color:#d14836;text-decoration:none}.uc-footer{color:#777;font-size:11px;padding-bottom:5ex;padding-top:5ex;text-align:center}.uc-footer a{color:#15c}.uc-footer a:visited{color:#61c}.uc-footer a:active{color:#d14836}.uc-footer-divider{color:#ccc;width:100%}</style><link rel="icon" href="null"/></head><body><div class="uc-main"><div id="uc-dl-icon" class="image-container"><div class="drive-sprite-aux-download-file"></div></div><div id="uc-text"><p class="uc-warning-caption">Google Drive can't scan this file for viruses.</p><p class="uc-warning-subcaption"><span class="uc-name-size"><a href="/open?id=1WyzcN1-I0n8BoeRhi_xVt8C5msqdx_7k">yolor-p6.pt</a> (72M)</span> is too large for Google to scan for viruses. Would you still like to download this file?</p><form id="downloadForm" action="https://drive.google.com/uc?export=download&amp;confirm&amp;id=1WyzcN1-I0n8BoeRhi_xVt8C5msqdx_7k&amp;confirm=t" method="post"><input type="submit" id="uc-download-link" class="goog-inline-block jfk-button jfk-button-action" value="Download anyway"/></form></div></div><div class="uc-footer"><hr class="uc-footer-divider"></div></body></html>

And this in turn leads to

Traceback (most recent call last):
  File "test.py", line 302, in <module>
    test(opt.data,
  File "test.py", line 55, in test
    model = attempt_load(weights, map_location=device)  # load FP32 model
  File "/home/aayush/yolor/models/experimental.py", line 137, in attempt_load
    model.append(torch.load(w, map_location=map_location)['model'].float().fuse().eval())  # load FP32 model
  File "/home/aayush/.local/lib/python3.8/site-packages/torch/serialization.py", line 713, in load
    return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
  File "/home/aayush/.local/lib/python3.8/site-packages/torch/serialization.py", line 920, in _legacy_load
    magic_number = pickle_module.load(f, **pickle_load_args)
_pickle.UnpicklingError: invalid load key, '<'.

When I manually copy paste the link for yolor_p6.pt in the browser

https://drive.google.com/uc?export=download&id=1Tdn3yqpZ79X7R1Ql0zNlNScB1Dv9Fp7

And a folder gets downloaded

https://drive.google.com/drive/folders/18IoN5F94WjRzvappk_4RRf8j9GIoPKc7?usp=sharing

I am not sure how to use this folder as the checkpoints ? Can anyone advise on how to download the checkpoints ?

Maharshi-joshi commented 2 years ago

Save it in google drive and then give the path of the drive in the train command

Aayush-Jain01 commented 2 years ago

Oh nice ! I gave it the path of this folder zipped (https://drive.google.com/drive/folders/18IoN5F94WjRzvappk_4RRf8j9GIoPKc7?usp=sharing) and it worked

AkshitRaizada commented 2 years ago

@Aayush-Jain01 can you please share the code for giving the path of the google folder to the program so that it gets downloaded?

Aayush-Jain01 commented 2 years ago

You can just download it from this https://drive.google.com/drive/folders/18IoN5F94WjRzvappk_4RRf8j9GIoPKc7?usp=sharing