SRGAN icon indicating copy to clipboard operation
SRGAN copied to clipboard

Problem while loading

Open NagasaiBharat opened this issue 6 years ago • 8 comments

I am trying to load the pretrained model vgg19 using command model = np.load('vgg19.npy') and getting the following error: 694 # The array contained Python objects. We need to unpickle the data. 695 if not allow_pickle: --> 696 raise ValueError("Object arrays cannot be loaded when " 697 "allow_pickle=False") 698 if pickle_kwargs is None:

ValueError: Object arrays cannot be loaded when allow_pickle=False

Basically, I am trying to test valid_LR images directly using the pretrained model.

NagasaiBharat avatar Jul 30 '19 06:07 NagasaiBharat

no model = np.load('vgg19.npy') in the latest code, could you try to update the code ?

zsdonghao avatar Jul 30 '19 06:07 zsdonghao

could you suggest how to use vgg19 model directly?

NagasaiBharat avatar Jul 30 '19 06:07 NagasaiBharat

this line https://github.com/tensorlayer/srgan/blob/master/train.py#L76

 VGG = tl.models.vgg19(pretrained=True, end_with='pool4', mode='static')

help you automatically download and load the model

zsdonghao avatar Jul 30 '19 06:07 zsdonghao

Change the code from: model = np.load('vgg19.npy') to: model = np.load('vgg19.npy', allow_pickle=True) At least that worked for me :)

AzzerAce avatar Aug 04 '19 09:08 AzzerAce

this line https://github.com/tensorlayer/srgan/blob/master/train.py#L76 VGG = tl.models.vgg19(pretrained=True, end_with='pool4', mode='static')

help you automatically download and load the model

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 me how to deal with it?Thank you.

yangyingni avatar Jan 18 '20 14:01 yangyingni

@Laicheng0830 similar

zsdonghao avatar Jan 19 '20 09:01 zsdonghao

@yangyingni Check that the data is downloaded completely. vgg19.npy https://github.com/tensorlayer/pretrained-models/tree/master/models

Laicheng0830 avatar Jan 20 '20 08:01 Laicheng0830

@Laicheng0830 hello, could you tell me how to use vgg19.npy? i also meet the same problem

Yushixiangqini avatar Feb 25 '20 09:02 Yushixiangqini