Yolov5: Can not download pre-trained weights in China.

Created on 15 Jun 2020  ·  17Comments  ·  Source: ultralytics/yolov5

The Google Drive can not access from China, maybe a BaiduYun link is good to Chinese people.

bug help wanted

Most helpful comment

The Google Drive can not access from China, maybe a BaiduYun link is good to Chinese people.
@shihaoyin
you can try this
链接:https://pan.baidu.com/s/1Zk2Ksfl_v-apbRBQ_mqc6w
提取码:00mp

All 17 comments

Hello @shihaoyin, thank you for your interest in our work! Please visit our Custom Training Tutorial to get started, and see our Jupyter Notebook Open In Colab, Docker Image, and Google Cloud Quickstart Guide for example environments.

If this is a bug report, please provide screenshots and minimum viable code to reproduce your issue, otherwise we can not help you.

If this is a custom model or data training question, please note that Ultralytics does not provide free personal support. As a leader in vision ML and AI, we do offer professional consulting, from simple expert advice up to delivery of fully customized, end-to-end production solutions for our clients, such as:

  • Cloud-based AI systems operating on hundreds of HD video streams in realtime.
  • Edge AI integrated into custom iOS and Android apps for realtime 30 FPS video inference.
  • Custom data training, hyperparameter evolution, and model exportation to any destination.

For more information please visit https://www.ultralytics.com.

@shihaoyin thank you for the bug report! This is a big problem indeed. We used to host weights on a GCP bucket which was able to be used in China, but Google was charging us monthly per download, so we switched to the current solution.

Perhaps we can update attempt_download() function to try Baidu if Google Drive is not reachable.

Are there any volunteers who might be able to do this and submit a PR?

https://github.com/ultralytics/yolov5/blob/c6fc4242a21cac23526c221994eff0886e303e0e/utils/google_utils.py#L10-L32

The Google Drive can not access from China, maybe a BaiduYun link is good to Chinese people.
@shihaoyin
you can try this
链接:https://pan.baidu.com/s/1Zk2Ksfl_v-apbRBQ_mqc6w
提取码:00mp

The Google Drive can not access from China, maybe a BaiduYun link is good to Chinese people.
@shihaoyin
you can try this
链接:https://pan.baidu.com/s/1Zk2Ksfl_v-apbRBQ_mqc6w
提取码:00mp

Download successfully,thanks a lot。

Are AWS (Amazon) S3 buckets/files accessible from China?

Are AWS (Amazon) S3 buckets/files accessible from China?

Not yet tested, maybe you can paste a file link on AWS S3, and I will test it.

@shihaoyin is this still a problem? I updated the code to try to fix this problem, so I believe the auto-download functionality should work for the entire world now, including China.

@glenn-jocher I am in Shanghai,China, the option is False. Wish us good luck!

The Google Drive can not access from China, maybe a BaiduYun link is good to Chinese people.
@shihaoyin
you can try this
链接:https://pan.baidu.com/s/1Zk2Ksfl_v-apbRBQ_mqc6w
提取码:00mp

I get it, thanks.

@Lornatang can you try to download these weights from Shanghai? I'm experimenting with a new weight hosting method :)

import torch

# method 1
torch.hub.download_url_to_file('https://storage.googleapis.com/ultralytics/yolov5/ckpt/yolov5x.pt', 'yolov5x_1.pt')

# method 2
torch.hub.download_url_to_file('https://github.com/ultralytics/yolov5/releases/download/v2.0/yolov5x.pt', 'yolov5x_2.pt')

@glenn-jocher Yes!

(base) ➜  ~ wget https://storage.googleapis.com/ultralytics/yolov5/ckpt/yolov5x.pt
--2020-08-01 10:44:46--  https://storage.googleapis.com/ultralytics/yolov5/ckpt/yolov5x.pt
正在解析主机 storage.googleapis.com (storage.googleapis.com)... 34.64.4.112, 34.64.4.80, 34.64.4.16
正在连接 storage.googleapis.com (storage.googleapis.com)|34.64.4.112|:443... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度: 178507455 (170M) [application/octet-stream]
正在保存至: “yolov5x.pt”

yolov5x.pt            1%[                    ]   2.82M  1.31MB/s               ^Z
[1]  + 21731 suspended  wget https://storage.googleapis.com/ultralytics/yolov5/ckpt/yolov5x.pt

Great! What about method 2 (different url):

import torch

# method 2
torch.hub.download_url_to_file('https://github.com/ultralytics/yolov5/releases/download/v2.0/yolov5x.pt', 'yolov5x_2.pt')

@glenn-jocher Yes. This is the method I have been using in projects

 (base) ➜  ~ wget https://github.com/ultralytics/yolov5/releases/download/v2.0/yolov5x.pt
--2020-08-01 12:49:11--  https://github.com/ultralytics/yolov5/releases/download/v2.0/yolov5x.pt
正在解析主机 github.com (github.com)... 140.82.113.3, 192.30.253.112
正在连接 github.com (github.com)|140.82.113.3|:443... 已连接。
已发出 HTTP 请求,正在等待回应... 302 Found
位置:https://github-production-release-asset-2e65be.s3.amazonaws.com/264818686/99d9dd80-d2bf-11ea-8ff8-a4f0684ba6c2?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20200801%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20200801T044915Z&X-Amz-Expires=300&X-Amz-Signature=73d2e672d61d51d53fb65837b66f76cb441d876a4f07a4641301eb9f31d7b45c&X-Amz-SignedHeaders=host&actor_id=0&repo_id=264818686&response-content-disposition=attachment%3B%20filename%3Dyolov5x.pt&response-content-type=application%2Foctet-stream [跟随至新的 URL]
--2020-08-01 12:49:15--  https://github-production-release-asset-2e65be.s3.amazonaws.com/264818686/99d9dd80-d2bf-11ea-8ff8-a4f0684ba6c2?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20200801%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20200801T044915Z&X-Amz-Expires=300&X-Amz-Signature=73d2e672d61d51d53fb65837b66f76cb441d876a4f07a4641301eb9f31d7b45c&X-Amz-SignedHeaders=host&actor_id=0&repo_id=264818686&response-content-disposition=attachment%3B%20filename%3Dyolov5x.pt&response-content-type=application%2Foctet-stream
正在解析主机 github-production-release-asset-2e65be.s3.amazonaws.com (github-production-release-asset-2e65be.s3.amazonaws.com)... 52.216.229.219
正在连接 github-production-release-asset-2e65be.s3.amazonaws.com (github-production-release-asset-2e65be.s3.amazonaws.com)|52.216.229.219|:443... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度: 178507455 (170M) [application/octet-stream]
正在保存至: “yolov5x.pt.1”

yolov5x.pt.1          0%[                    ]  24.58K   940 B/s    剩余 2d 4h ^C

For speed, I recommend you to use the first method.

Ok great! What speed difference do you see between the two methods?

Take users in Mainland China as an example:

If you are not using a VPN, use

import torch

# method 1
torch.hub.download_url_to_file('https://storage.googleapis.com/ultralytics/yolov5/ckpt/yolov5x.pt', 'yolov5x_1.pt')

else

import torch

# method 2
torch.hub.download_url_to_file('https://github.com/ultralytics/yolov5/releases/download/v2.0/yolov5x.pt', 'yolov5x_2.pt')

Both methods can get the same weight, it's just a matter of speed.

@glenn-jocher
I see a huge difference, it may be the difference between 5M and 50K.

@Lornatang ok, thanks!

Was this page helpful?
0 / 5 - 0 ratings