facebookresearch / Detectron

FAIR's research platform for object detection research, implementing popular algorithms like Mask R-CNN and RetinaNet.
Apache License 2.0
26.24k stars 5.45k forks source link

The migration to dl.fbaipublicfiles.com raises assertionError #792

Open AmitaiPerlstein opened 5 years ago

AmitaiPerlstein commented 5 years ago

Changing the route of pre-trained model to
https://dl.fbaipublicfiles.com/detectron//ImageNetPretrained/MSRA/R-50.pkl raises the following assertion error:

File "/home/ubuntu/deploy/detectron/detectron/core/config.py", line 1081, in assert_and_infer_cfg cache_cfg_urls() File "/home/ubuntu/deploy/detectron/detectron/core/config.py", line 1090, in cache_cfg_urls __C.TRAIN.WEIGHTS = cache_url(C.TRAIN.WEIGHTS, C.DOWNLOAD_CACHE) File "/home/ubuntu/deploy/detectron/detectron/utils/io.py", line 80, in cache_url 'bucket: {}').format(_DETECTRON_S3_BASE_URL) AssertionError: Detectron only automatically caches URLs in the Detectron S3 bucket: https://s3-us-west-2.amazonaws.com/detectron

staying with the older path, https://s3-us-west-2.amazonaws.com/detectron/ImageNetPretrained/MSRA/R-50.pkl raises the following urllib2 error:

assert_and_infer_cfg()

File "/home/ubuntu/deploy/detectron/detectron/core/config.py", line 1081, in assert_and_infer_cfg cache_cfg_urls() File "/home/ubuntu/deploy/detectron/detectron/core/config.py", line 1090, in cache_cfg_urls __C.TRAIN.WEIGHTS = cache_url(C.TRAIN.WEIGHTS, C.DOWNLOAD_CACHE) File "/home/ubuntu/deploy/detectron/detectron/utils/io.py", line 92, in cache_url download_url(url, cache_file_path) File "/home/ubuntu/deploy/detectron/detectron/utils/io.py", line 138, in download_url response = urllib.request.urlopen(url) File "/home/ubuntu/anaconda3/envs/detectron/lib/python2.7/urllib2.py", line 154, in urlopen return opener.open(url, data, timeout) File "/home/ubuntu/anaconda3/envs/detectron/lib/python2.7/urllib2.py", line 435, in open response = meth(req, response) File "/home/ubuntu/anaconda3/envs/detectron/lib/python2.7/urllib2.py", line 548, in http_response 'http', request, response, code, msg, hdrs) File "/home/ubuntu/anaconda3/envs/detectron/lib/python2.7/urllib2.py", line 473, in error return self._call_chain(args) File "/home/ubuntu/anaconda3/envs/detectron/lib/python2.7/urllib2.py", line 407, in _call_chain result = func(args) File "/home/ubuntu/anaconda3/envs/detectron/lib/python2.7/urllib2.py", line 556, in http_error_default raise HTTPError(req.get_full_url(), code, msg, hdrs, fp) urllib2.HTTPError: HTTP Error 403: Forbidden

How can pre-trained models be loaded?

ir413 commented 5 years ago

Hi @AmitaiPerlstein, from the assertion error message it seems that you are using a version of detectron that does not include changes from 5ed75f9d672b3c78b7da92d9b2321d04f33a7ccc (the updated base url in particular).

Could you please rebase on 5ed75f9d672b3c78b7da92d9b2321d04f33a7ccc (or latest master) and retry?

kebwi commented 5 years ago

I'm facing the same issue from a fresh git clone. Why should I need to rebase the stock download of the project?

At any rate, what is the exact git incantation you are recommending? "git rebase --onto 5ed75fd master" didn't seem to be correct. Admittedly, it was a bit of a guess.

xiang-zhe commented 5 years ago

i got similar problem in docker, urllib2.HTTPError: HTTP Error 404: Forbidden; so i changed the configs according https://github.com/facebookresearch/Detectron/commit/5ed75f9d672b3c78b7da92d9b2321d04f33a7ccc, namely , s3-us-west-2.amazonaws.com/ to dl.fbaipublicfiles.com than i got the problem AssertionError: Detectron only automatically caches URLs in the Detectron S3 bucket: https://s3-us-west-2.amazonaws.com/detectron; and it was solved in https://github.com/facebookresearch/Detectron/issues/820

gkv91 commented 5 years ago

Same error here..

garimss commented 5 years ago

Hi, I am also getting same error, not sure how to rebase. I am trying to run densepose and I have build detectron inside densepose caffe.

@ir413 I am getting below error. Can you help me with this

(pytorch) D:\git_hub\DensePose>python tools/infer_simple.py --cfg configs/DensePose_ResNet101_FPN_s1x-e2e.yaml --output-dir DensePoseData/Garima_Output/ --image-ext jpg --wts https://dl.fbaipublicfiles.com/densepose/DensePose_ResNet101_FPN_s1x-e2e.pkl DensePoseData/demo_data/demo_im.jpg Found Detectron ops lib: C:\Users\Garima\Anaconda3\envs\pytorch\lib\site-packages\torch/lib/caffe2_detectron_ops_gpu.dll [E ..\caffe2\core\init_intrinsics_check.cc:43] CPU feature avx is present on your machine, but the Caffe2 binary is not compiled with it. It means you may not get the full speed of your CPU. [E ..\caffe2\core\init_intrinsics_check.cc:43] CPU feature avx2 is present on your machine, but the Caffe2 binary is not compiled with it. It means you may not get the full speed of your CPU. [E ..\caffe2\core\init_intrinsics_check.cc:43] CPU feature fma is present on your machine, but the Caffe2 binary is not compiled with it. It means you may not get the full speed of your CPU. d:\git_hub\densepose\detectron2\$detectron\detectron\core\config.py:1182: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details. return envu.yaml_load(cfg_to_load) Traceback (most recent call last): File "tools/infer_simple.py", line 141, in main(args) File "tools/infer_simple.py", line 90, in main args.weights = cache_url(args.weights, cfg.DOWNLOAD_CACHE) File "d:\git_hub\densepose\detectron2\$detectron\detectron\utils\io.py", line 101, in cache_url 'bucket: {}').format(_DETECTRON_S3_BASE_URL) AssertionError: Detectron only automatically caches URLs in the Detectron S3 bucket: https://dl.fbaipublicfiles.com/detectron

progvasu commented 4 years ago

@garimss you have to change the base URL "_DETECTRON_S3_BASE_URL" at line 36 in io.py