tensorlayer / SRGAN

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

ValueError: setting an array element with a sequence #2

Closed BUPTLdy closed 7 years ago

BUPTLdy commented 7 years ago

I use the latest tensorflow and tensorlayer,I only changed batch_size from 16 to 4, but get the following error:

`Epoch [ 0/100] 0 time: 14.7791s, mse: 0.21392143 Epoch [ 0/100] 1 time: 0.8450s, mse: 0.26192695 Epoch [ 0/100] 2 time: 0.9554s, mse: 0.17628016 Epoch [ 0/100] 3 time: 0.6539s, mse: 0.26824623 Epoch [ 0/100] 4 time: 0.5328s, mse: 0.24897709 Epoch [ 0/100] 5 time: 1.0997s, mse: 0.27270195 Epoch [ 0/100] 6 time: 0.7496s, mse: 0.23530428 Epoch [ 0/100] 7 time: 0.3676s, mse: 0.25137147 Epoch [ 0/100] 8 time: 0.4393s, mse: 0.38204724 Epoch [ 0/100] 9 time: 0.4401s, mse: 0.21372676 Epoch [ 0/100] 10 time: 0.3587s, mse: 0.36686033 Epoch [ 0/100] 11 time: 0.5300s, mse: 0.18018314 Epoch [ 0/100] 12 time: 0.5174s, mse: 0.19175643 Epoch [ 0/100] 13 time: 0.4631s, mse: 0.16485015 Epoch [ 0/100] 14 time: 0.3546s, mse: 0.22096643 Epoch [ 0/100] 15 time: 0.4885s, mse: 0.20787539 Epoch [ 0/100] 16 time: 0.3442s, mse: 0.23604630 Epoch [ 0/100] 17 time: 0.3414s, mse: 0.24624050 Epoch [ 0/100] 18 time: 0.3520s, mse: 0.17463605 Epoch [ 0/100] 19 time: 0.4458s, mse: 0.13338993 Epoch [ 0/100] 20 time: 0.3602s, mse: 0.11997821 Epoch [ 0/100] 21 time: 0.4222s, mse: 0.24578686 Epoch [ 0/100] 22 time: 0.3538s, mse: 0.14088324 Epoch [ 0/100] 23 time: 0.3547s, mse: 0.21345212 Epoch [ 0/100] 24 time: 0.3659s, mse: 0.15475541 Epoch [ 0/100] 25 time: 0.3523s, mse: 0.19058520 Epoch [ 0/100] 26 time: 0.3555s, mse: 0.10877486 Epoch [ 0/100] 27 time: 0.4412s, mse: 0.15190440 Exception in thread threading_and_return: Traceback (most recent call last): File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner self.run() File "/usr/lib/python2.7/threading.py", line 754, in run self.target(*self.args, self.__kwargs) File "/home/ldy/2017/SRGAN/tensorlayer/prepro.py", line 87, in apply_fn results[i] = fn(data, kwargs) File "/home/ldy/2017/SRGAN/utils.py", line 17, in crop_sub_imgs_fn x = crop(x, wrg=384, hrg=384, is_random=is_random) File "/home/ldy/2017/SRGAN/tensorlayer/prepro.py", line 232, in crop h, w = x.shape[row_index], x.shape[col_index] IndexError: tuple index out of range

Exception in thread threading_and_return: Traceback (most recent call last): File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner self.run() File "/usr/lib/python2.7/threading.py", line 754, in run self.target(*self.args, self.__kwargs) File "/home/ldy/2017/SRGAN/tensorlayer/prepro.py", line 87, in apply_fn results[i] = fn(data, kwargs) File "/home/ldy/2017/SRGAN/utils.py", line 24, in downsample_fn x = imresize(x, size=[96, 96], interp='bicubic', mode=None) File "/home/ldy/2017/SRGAN/tensorlayer/prepro.py", line 834, in imresize if x.shape[-1] == 1: AttributeError: 'NoneType' object has no attribute 'shape'

Traceback (most recent call last): File "main.py", line 341, in train() File "main.py", line 201, in train errM, _ = sess.run([mse_loss, g_optim_init], {t_image: b_imgs_96, t_target_image: b_imgs_384}) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 789, in run run_metadata_ptr) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 968, in _run np_val = np.asarray(subfeed_val, dtype=subfeed_dtype) File "/usr/local/lib/python2.7/dist-packages/numpy/core/numeric.py", line 531, in asarray return array(a, dtype, copy=False, order=order) ValueError: setting an array element with a sequence.`

BUPTLdy commented 7 years ago

Sorry, there is a corrupted image in my training set.