tensorlayer / SRGAN

Photo-Realistic Single Image Super-Resolution Using a Generative Adversarial Network
https://github.com/tensorlayer/tensorlayerx
3.24k stars 813 forks source link

OSError: Failed to interpret file 'models\\vgg19.npy' as a pickle #217

Open meeng251 opened 3 years ago

meeng251 commented 3 years ago

Hi all, I have an error like this:

Traceback (most recent call last): File "V:\Python 3.6.8\lib\site-packages\numpy\lib\npyio.py", line 447, in load return pickle.load(fid, **pickle_kwargs) _pickle.UnpicklingError: invalid load key, 'v'.

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "train.py", line 200, in

File "train.py", line 74, in train G = get_G((batch_size, 96, 96, 3)) File "V:\Python 3.6.8\lib\site-packages\tensorlayer\models\vgg.py", line 319, in vgg19 restore_model(model, layer_type='vgg19') File "V:\Python 3.6.8\lib\site-packages\tensorlayer\models\vgg.py", line 171, in restore_model npz = np.load(os.path.join('models', model_saved_name[layer_type]), allow_pickle=True, encoding='latin1').item() File "V:\Python 3.6.8\lib\site-packages\numpy\lib\npyio.py", line 450, in load "Failed to interpret file %s as a pickle" % repr(file))

OSError: Failed to interpret file 'models\\vgg19.npy' as a pickle

I need help with this problem, someone can have me, please?

Python 3.6.8 Tensorflow 2.0.0 Tensorlayer 2.2.3 Numpy 1.16.2

@Laicheng0830 @zsdonghao

Laicheng0830 commented 3 years ago

The vgg19.npy download is incomplete. you can try manually download, copy the model to V:\Python 3.6.8\lib\site-packages\tensorlayer\models\models\

download link:https://github.com/tensorlayer/pretrained-models/tree/master/models

Laicheng0830 commented 3 years ago

Notes .delete incomplete files in the V:\Python 3.6.8\lib\site-packages\tensorlayer\models\models\vgg19.npy

husterwang commented 1 year ago

@Laicheng0830 Sorry, I have the same problem and I haven't solved it by downloading again.

Laicheng0830 commented 1 year ago

@husterwang You can get the model parameters from here.

husterwang commented 1 year ago

Thanks a lot!

------------------ 原始邮件 ------------------ 发件人: "tensorlayer/srgan" @.>; 发送时间: 2022年7月27日(星期三) 下午3:43 @.>; @.**@.>; 主题: Re: [tensorlayer/srgan] OSError: Failed to interpret file 'models\vgg19.npy' as a pickle (#217)

@husterwang You can get the model parameters from here.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>