CenterNet icon indicating copy to clipboard operation
CenterNet copied to clipboard

urllib.error.HTTPError: HTTP Error 404: Not Found

Open Innan666 opened this issue 6 years ago • 7 comments

(measure) C:\Users\IFL\Desktop\Liu\Detector\CenterNet\src>python demo.py ctdet --demo webcam --load_model ../models/ctdet_coco_dla_2x.pth Fix size testing. training chunk_sizes: [32] The output will be saved to C:\Users\IFL\Desktop\Liu\Detector\CenterNet\src\lib....\exp\ctdet\default heads {'hm': 80, 'wh': 2, 'reg': 2} Creating model... Downloading: "http://dl.yf.io/dla/models\imagenet\dla34-ba72cf86.pth" to C:\Users\IFL/.cache\torch\checkpoints\dla34-ba72cf86.pth Traceback (most recent call last): File "demo.py", line 56, in demo(opt) File "demo.py", line 21, in demo detector = Detector(opt) File "C:\Users\IFL\Desktop\Liu\Detector\CenterNet\src\lib\detectors\ctdet.py", line 22, in init super(CtdetDetector, self).init(opt) File "C:\Users\IFL\Desktop\Liu\Detector\CenterNet\src\lib\detectors\base_detector.py", line 24, in init self.model = create_model(opt.arch, opt.heads, opt.head_conv) File "C:\Users\IFL\Desktop\Liu\Detector\CenterNet\src\lib\models\model.py", line 28, in create_model model = get_model(num_layers=num_layers, heads=heads, head_conv=head_conv) File "C:\Users\IFL\Desktop\Liu\Detector\CenterNet\src\lib\models\networks\pose_dla_dcn.py", line 491, in get_pose_net head_conv=head_conv) File "C:\Users\IFL\Desktop\Liu\Detector\CenterNet\src\lib\models\networks\pose_dla_dcn.py", line 434, in init self.base = globals()base_name File "C:\Users\IFL\Desktop\Liu\Detector\CenterNet\src\lib\models\networks\pose_dla_dcn.py", line 314, in dla34 model.load_pretrained_model(data='imagenet', name='dla34', hash='ba72cf86') File "C:\Users\IFL\Desktop\Liu\Detector\CenterNet\src\lib\models\networks\pose_dla_dcn.py", line 300, in load_pretrained_model model_weights = model_zoo.load_url(model_url) File "C:\Users\IFL\Anaconda3\envs\measure\lib\site-packages\torch\hub.py", line 433, in load_state_dict_from_url _download_url_to_file(url, cached_file, hash_prefix, progress=progress) File "C:\Users\IFL\Anaconda3\envs\measure\lib\site-packages\torch\hub.py", line 349, in _download_url_to_file u = urlopen(url) File "C:\Users\IFL\Anaconda3\envs\measure\lib\urllib\request.py", line 223, in urlopen return opener.open(url, data, timeout) File "C:\Users\IFL\Anaconda3\envs\measure\lib\urllib\request.py", line 532, in open response = meth(req, response) File "C:\Users\IFL\Anaconda3\envs\measure\lib\urllib\request.py", line 642, in http_response 'http', request, response, code, msg, hdrs) File "C:\Users\IFL\Anaconda3\envs\measure\lib\urllib\request.py", line 570, in error return self._call_chain(*args) File "C:\Users\IFL\Anaconda3\envs\measure\lib\urllib\request.py", line 504, in _call_chain result = func(*args) File "C:\Users\IFL\Anaconda3\envs\measure\lib\urllib\request.py", line 650, in http_error_default raise HTTPError(req.full_url, code, msg, hdrs, fp) urllib.error.HTTPError: HTTP Error 404: Not Found

Can you tell me how can i fix it?

Innan666 avatar Jul 18 '19 11:07 Innan666

directly download the file from url save it to the target folder @Innan666

VRCMF avatar Jul 19 '19 08:07 VRCMF

I got the same issue. I tried to get http://dl.yf.io/dla/models\imagenet\dla34-ba72cf86.pth but I got 404 error also. How can we fix it?

haryngod avatar Sep 24 '19 05:09 haryngod

I got the same issue. I tried to get but I got 404 error also. How can we fix it?

I got it. Get into http://dl.yf.io/dla/models/imagenet and download dla34-ba72cf86.pth directly.

haryngod avatar Sep 24 '19 05:09 haryngod

@Innan666 , @haryngod

in windows system has problem at that parts. so u should change that cord or download directly.

u can change that part like below;

url = 'http://dl.yf.io/dla/models/' + data + '/{}-{}.pth'.format(name, hash)
return url

seungtaek94 avatar Nov 25 '20 04:11 seungtaek94

I got the same issue. I tried to get but I got 404 error also. How can we fix it?

I got it. Get into http://dl.yf.io/dla/models/imagenet and download dla34-ba72cf86.pth directly.

Where do I put it when I download it

howdidthatwork avatar Jul 18 '21 00:07 howdidthatwork

@Innan666 , @haryngod

in windows system has problem at that parts. so u should change that cord or download directly.

u can change that part like below;

url = 'http://dl.yf.io/dla/models/' + data + '/{}-{}.pth'.format(name, hash)
return url

Thank you for your help, where do I put it when I download directly

howdidthatwork avatar Jul 18 '21 00:07 howdidthatwork

@howdidthatwork

I fixed the problem by downloading the pre-trained model on the link given by @haryngod then paste the pre-trained model in the checkpoint folder model

FabriceNdayi avatar Sep 13 '21 01:09 FabriceNdayi