Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't get VGG: urllib.error.HTTPError: HTTP Error 404: Not Found #1099

Open
protoneqt opened this issue Aug 20, 2020 · 7 comments
Open

Can't get VGG: urllib.error.HTTPError: HTTP Error 404: Not Found #1099

protoneqt opened this issue Aug 20, 2020 · 7 comments

Comments

@protoneqt
Copy link

I'm trying to run train.py for SRGAN code:
https://github.com/tensorlayer/SRGAN
And I have the error in the following line:
VGG = tl.models.vgg19(pretrained=True, end_with='pool4', mode='static')
Probably, it's because I have a firewall but I don't know how to get this model another way. Can I download the model using another computer and just copy the model to my computer? If yes, how to do it?
The full error is:
Traceback (most recent call last):

  File "C:\Users\a.shlyapin\AppData\Local\JetBrains\Toolbox\apps\PyCharm-C\ch-0\201.7223.92\plugins\python-ce\helpers\pydev\pydevd.py", line 1438, in _exec
    pydev_imports.execfile(file, globals, locals)  # execute the script
  File "C:\Users\a.shlyapin\AppData\Local\JetBrains\Toolbox\apps\PyCharm-C\ch-0\201.7223.92\plugins\python-ce\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 18, in execfile
    exec(compile(contents+"\n", file, 'exec'), glob, loc)
  File "E:/home/projects/deblur/git/srgan/train.py", line 205, in <module>
    train()
  File "E:/home/projects/deblur/git/srgan/train.py", line 79, in train
    VGG = tl.models.vgg19(pretrained=True, end_with='pool4', mode='static')
  File "E:\home\projects\main\git\enp\venv2\lib\site-packages\tensorlayer\models\vgg.py", line 319, in vgg19
    restore_model(model, layer_type='vgg19')
  File "E:\home\projects\main\git\enp\venv2\lib\site-packages\tensorlayer\models\vgg.py", line 160, in restore_model
    maybe_download_and_extract(model_saved_name[layer_type], 'models', model_urls[layer_type])
  File "E:\home\projects\main\git\enp\venv2\lib\site-packages\tensorlayer\files\utils.py", line 2465, in maybe_download_and_extract
    _download(filename, working_directory, url_source)
  File "E:\home\projects\main\git\enp\venv2\lib\site-packages\tensorlayer\files\utils.py", line 2458, in _download
    urlretrieve(url_source + filename, filepath, reporthook=_dlProgress)
  File "C:\Python37\lib\urllib\request.py", line 247, in urlretrieve
    with contextlib.closing(urlopen(url, data)) as fp:
  File "C:\Python37\lib\urllib\request.py", line 222, in urlopen
    return opener.open(url, data, timeout)
  File "C:\Python37\lib\urllib\request.py", line 531, in open
    response = meth(req, response)
  File "C:\Python37\lib\urllib\request.py", line 641, in http_response
    'http', request, response, code, msg, hdrs)
  File "C:\Python37\lib\urllib\request.py", line 569, in error
    return self._call_chain(*args)
  File "C:\Python37\lib\urllib\request.py", line 503, in _call_chain
    result = func(*args)
  File "C:\Python37\lib\urllib\request.py", line 649, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 404: Not Found

@Laicheng0830
Copy link
Member

Laicheng0830 commented Aug 21, 2020

You can download vgg19 model from:https://drive.google.com/file/d/1pZ0v-sLj-glfSx3Cssk_aBFRI8mF0hiq/view?usp=sharing
Place the file in the directory /models.

@priyagupta18
Copy link

@Laicheng0830 I downloaded the model but running model = np.load('vgg19.npy', encoding='latin1',allow_pickle=True) gives the error 'Failed to interpret file 'vgg19.npy' as a pickle'. How to resolve ?

@LILIXIYA
Copy link

Same issue here.

@LILIXIYA
Copy link

@priyagupta18 Have you already solved the issue?
@Laicheng0830 I have the same HTTP issue with @priyagupta18 even in the U.S. I don't think it's because of the GFW.

@Laicheng0830
Copy link
Member

vgg19 link :https://drive.google.com/file/d/1pZ0v-sLj-glfSx3Cssk_aBFRI8mF0hiq/view?usp=sharing
This is a problem with Git downloading large files.
@LILIXIYA

@LILIXIYA
Copy link

Thank you so much!

@waqar3411
Copy link

i am also facing same problem... and downloading vgg19 from the link and adding in directory won't help in kaggle. as it downloads the vgg19 model in output folder and it can't write or download it in input folder...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants