SRGAN icon indicating copy to clipboard operation
SRGAN copied to clipboard

Load Error

Open jiangshashen opened this issue 7 years ago • 13 comments

when I do experiment, come out a error as follow: [TL] [!] Load checkpoint/g_srgan.npz failed! [TL] [!] Load checkpoint/g_srgan_init.npz failed! [TL] [!] Load checkpoint/d_srgan.npz failed!

I find check_point is empty

jiangshashen avatar Apr 10 '18 10:04 jiangshashen

use .png picture not others

pustar avatar Apr 28 '18 07:04 pustar

yes, it is missing, that is why you need to train one ..

zsdonghao avatar Apr 28 '18 18:04 zsdonghao

@zsdonghao So, we need to comment the parameter loading lines in the main.py file?

sdlpkxd avatar Jun 04 '18 12:06 sdlpkxd

you don't need to remove it, it can only work when you have a pre-trained model.

zsdonghao avatar Jun 04 '18 12:06 zsdonghao

Got it, thanks

sdlpkxd avatar Jun 13 '18 09:06 sdlpkxd

Hi, Where can I get a pre-trained model? Also I don't quite understand the purpose of these checkpoints if I want to do the initial training.

eupenik avatar Sep 04 '18 13:09 eupenik

@eugeneu check readme

zsdonghao avatar Sep 04 '18 13:09 zsdonghao

I got VGG19 from https://mega.nz/#!xZ8glS6J!MAnE91ND_WyfZ_8mvkuSa2YcA7q-1ehfSm-Q1fxOvvs And I got g_srgan.npz from here https://github.com/tensorlayer/srgan/releases/tag/1.2.0 But,

[TL] [*] Load checkpoint/g_srgan.npz SUCCESS!
[TL] [!] Load checkpoint/d_srgan.npz failed!
Traceback (most recent call last):
  File "main.py", line 310, in <module>
    train()
  File "main.py", line 118, in train
    npz = np.load(vgg19_npy_path, encoding='latin1').item()
  File "/anaconda/envs/py35/lib/python3.5/site-packages/numpy/lib/npyio.py", line 421, in load
    pickle_kwargs=pickle_kwargs)
  File "/anaconda/envs/py35/lib/python3.5/site-packages/numpy/lib/format.py", line 650, in read_array
    array = pickle.load(fp, **pickle_kwargs)
EOFError: Ran out of input

eupenik avatar Sep 04 '18 14:09 eupenik

@eugeneu could you try this vgg19? https://github.com/tensorlayer/pretrained-models/tree/master/models

zsdonghao avatar Sep 04 '18 20:09 zsdonghao

Hi @zsdonghao I changed vgg19 to the version from the link you provided, and now the training starts. Thank you!

eupenik avatar Sep 05 '18 13:09 eupenik

hi @zsdonghao [TL] [*] Load checkpoint/g_srgan.npz SUCCESS! [TL] [!] Load checkpoint/d_srgan.npz failed! Loading conv1_1: (3, 3, 3, 64), (64,) Loading conv1_2: (3, 3, 64, 64), (64,) Loading conv2_1: (3, 3, 64, 128), (128,) Loading conv2_2: (3, 3, 128, 128), (128,) Loading conv3_1: (3, 3, 128, 256), (256,) Loading conv3_2: (3, 3, 256, 256), (256,) Loading conv3_3: (3, 3, 256, 256), (256,) Loading conv3_4: (3, 3, 256, 256), (256,) Loading conv4_1: (3, 3, 256, 512), (512,) Loading conv4_2: (3, 3, 512, 512), (512,) Loading conv4_3: (3, 3, 512, 512), (512,) Loading conv4_4: (3, 3, 512, 512), (512,) Loading conv5_1: (3, 3, 512, 512), (512,) Loading conv5_2: (3, 3, 512, 512), (512,) Loading conv5_3: (3, 3, 512, 512), (512,) Loading conv5_4: (3, 3, 512, 512), (512,) Loading fc6: (25088, 4096), (4096,) Loading fc7: (4096, 4096), (4096,) Loading fc8: (4096, 1000), (1000,) Traceback (most recent call last):

File "", line 1, in runfile('C:/Users/relax/merve/srgan-master/srgan-master/main.py', wdir='C:/Users/relax/merve/srgan-master/srgan-master')

File "C:\Users\relax\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 668, in runfile execfile(filename, namespace)

File "C:\Users\relax\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 108, in execfile exec(compile(f.read(), filename, 'exec'), namespace)

File "C:/Users/relax/merve/srgan-master/srgan-master/main.py", line 310, in train()

File "C:/Users/relax/merve/srgan-master/srgan-master/main.py", line 135, in train print('sample HR sub-image:', sample_imgs_384.shape, sample_imgs_384.min(), sample_imgs_384.max())

File "C:\Users\relax\Anaconda3\lib\site-packages\numpy\core_methods.py", line 32, in _amin return umr_minimum(a, axis, None, out, keepdims, initial)

ValueError: zero-size array to reduction operation minimum which has no identity

I try two vgg19 model which you gived how can I fix it ?

mrveozsahn avatar Oct 26 '18 17:10 mrveozsahn

Hello sir, can you help me? I have downloaded your latest code, but I got this error when load the VGG Traceback (most recent call last): File "train.py", line 202, in train() File "train.py", line 76, in train VGG = tl.models.vgg19(pretrained=True, end_with='pool4', mode='static') File "C:\Users\Howard\Miniconda3\envs\thesis\lib\site-packages\tensorlayer\mod els\vgg.py", line 318, in vgg19 restore_model(model, layer_type='vgg19') File "C:\Users\Howard\Miniconda3\envs\thesis\lib\site-packages\tensorlayer\mod els\vgg.py", line 170, in restore_model npz = np.load(os.path.join('models', model_saved_name[layer_type]), encoding ='latin1').item() File "C:\Users\Howard\Miniconda3\envs\thesis\lib\site-packages\numpy\lib\npyio .py", line 447, in load pickle_kwargs=pickle_kwargs) File "C:\Users\Howard\Miniconda3\envs\thesis\lib\site-packages\numpy\lib\forma t.py", line 696, in read_array raise ValueError("Object arrays cannot be loaded when " ValueError: Object arrays cannot be loaded when allow_pickle=False

I have tried to edit the vgg.py on my library, change the model urls from: https://media.githubusercontent.com/media/tensorlayer/pretrained-models/master/models/ to https://github.com/tensorlayer/pretrained-models/blob/master/models/vgg19.npy but I still got the same error

HowardMartin avatar Nov 29 '19 04:11 HowardMartin

@eugeneu could you try this vgg19? https://github.com/tensorlayer/pretrained-models/tree/master/models

Hello,i used VGG = tl.models.vgg19(pretrained=True, end_with='pool4', mode='static') to load vgg19,but it shows _pickle.UnpicklingError: pickle data was truncated.Can you tell men why and what should i do?I need your help and Thank you very much.

yangyingni avatar Jan 18 '20 14:01 yangyingni