tensorlayer / TensorLayer

Deep Learning and Reinforcement Learning Library for Scientists and Engineers
http://tensorlayerx.com
Other
7.31k stars 1.61k forks source link

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

Open protoneqt opened 3 years ago

protoneqt commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

@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 commented 3 years ago

Same issue here.

LILIXIYA commented 3 years ago

@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 commented 3 years ago

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 commented 3 years ago

Thank you so much!

waqar3411 commented 2 years ago

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...