AttGAN-Cartoon-Tensorflow icon indicating copy to clipboard operation
AttGAN-Cartoon-Tensorflow copied to clipboard

Train fail

Open GilbertTam opened this issue 4 years ago • 7 comments

Hello, Have you face the same problem below?

File "train.py", line 306, in sample(ep, it) File "train.py", line 251, in run im.imwrite(sample, '%s/Epoch-%d_Iter-%d.jpg' % (save_dir, epoch, iter)) ... 'images should be in the range of %s!' % (l + ',' + r) AssertionError: images should be in the range of [-1.0,1.0]!

It's my download data problem?

GilbertTam avatar Jun 20 '20 01:06 GilbertTam

@GilbertTam What modification did you made?

LynnHo avatar Jun 20 '20 03:06 LynnHo

I just run train ,no parameters change when epoch is 15 will fail

GilbertTam avatar Jun 24 '20 02:06 GilbertTam

@GilbertTam Do the images in the output folder make sense? I just rerun the code but haven't got any error.

LynnHo avatar Jun 30 '20 03:06 LynnHo

hi,i have the same problem,no parameters change. run in cpu mode,It's problem?

python 3.6.9 tensorflow-gpu 1.15.0 cuda 10.2 cudnn 7.6

error output:

Inner Epoch Loop:  40%|█████████████████████████████████████████████████████████| 99/250 [06:59<10:40,  4.24s/it]
Epoch Loop:   3%|████                                                                                                          | 14/500 [4:09:19<144:15:05, 1068.53s/it]
Traceback (most recent call last):
  File "train.py", line 306, in <module>
    sample(ep, it)
  File "train.py", line 251, in run
    im.imwrite(sample, '%s/Epoch-%d_Iter-%d.jpg' % (save_dir, epoch, iter))
  File "/home/git_prj/AttGAN-Cartoon-Tensorflow/imlib/basic.py", line 23, in imwrite
    iio.imsave(path, dtype.im2uint(image), quality=quality, **plugin_args)
  File "/home/git_prj/AttGAN-Cartoon-Tensorflow/imlib/dtype.py", line 51, in im2uint
    return to_range(images, 0, 255, np.uint8)
  File "/home/git_prj/AttGAN-Cartoon-Tensorflow/imlib/dtype.py", line 32, in to_range
    _check(images, [np.float32, np.float64], -1.0, 1.0)
  File "/home/git_prj/AttGAN-Cartoon-Tensorflow/imlib/dtype.py", line 27, in _check
    '`images` should be in the range of %s!' % (l + ',' + r)
AssertionError: `images` should be in the range of [-1.0,1.0]!

millionsofluo avatar Dec 08 '20 02:12 millionsofluo

On this issue,I changed it here ,Then it run.

# File "train.py"
# run(epoch, iter)
try:
    im.imwrite(sample, '%s/Epoch-%d_Iter-%d.jpg' %
                       (save_dir, epoch, iter))
except:
    print('ERROR: Could not save %s/Epoch-%d_Iter-%d.jpg' %
                  (save_dir, epoch, iter))

millionsofluo avatar Dec 08 '20 07:12 millionsofluo

@millionsofluo I am still confused by this problem. Is there any good results in the output folder.

LynnHo avatar Dec 08 '20 08:12 LynnHo

@LynnHo Yes,This folder has good results,Very strange.

Epoch-11_Iter-249.jpg  Epoch-2_Iter-99.jpg   Epoch-9_Iter-149.jpg
Epoch-19_Iter-49.jpg   Epoch-4_Iter-199.jpg
Epoch-21_Iter-149.jpg  Epoch-7_Iter-49.jpg

millionsofluo avatar Dec 08 '20 08:12 millionsofluo