taki0112 / UGATIT

Official Tensorflow implementation of U-GAT-IT: Unsupervised Generative Attentional Networks with Adaptive Layer-Instance Normalization for Image-to-Image Translation (ICLR 2020)
MIT License
6.17k stars 1.04k forks source link

Use 512px images instead of 256px #62

Open artempimushkin opened 5 years ago

artempimushkin commented 5 years ago

Hey! I'm trying to use 512px images instead of 256px for better quality. I changed default flag from 256 to 512 in main.py - parser.add_argument('--img_size', type=int, default=512, help='The size of image') and changed self.load_size == 256 to self.load_size == 512 in function image_processing() in utils.py. But the script crashes (I'm using RTX 2080Ti 11GB with --light) with the following output:


  File "main.py", line 108, in <module>
    main()
  File "main.py", line 100, in main
    gan.train()
  File "/home/p0wx/prj/UGATIT/UGATIT.py", line 542, in train
    self.Generator_loss, self.G_loss], feed_dict = train_feed_dict)
  File "/home/p0wx/.local/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 950, in run
    run_metadata_ptr)
  File "/home/p0wx/.local/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1173, in _run
    feed_dict_tensor, options, run_metadata)
  File "/home/p0wx/.local/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1350, in _do_run
    run_metadata)
  File "/home/p0wx/.local/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1370, in _do_call
    raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.ResourceExhaustedError: 2 root error(s) found.
  (0) Resource exhausted: OOM when allocating tensor with shape[1,64,518,518] and type float on /job:localhost/replica:0/task:0/device:GPU:0 by allocator GPU_0_bfc
     [[{{node generator_A_2/G_logit/conv2d/Conv2D-0-TransposeNHWCToNCHW-LayoutOptimizer}}]]
Hint: If you want to see a list of allocated tensors when OOM happens, add report_tensor_allocations_upon_oom to RunOptions for current allocation info.

     [[ArithmeticOptimizer/AddOpsRewrite_add_39/_203]]
Hint: If you want to see a list of allocated tensors when OOM happens, add report_tensor_allocations_upon_oom to RunOptions for current allocation info.

  (1) Resource exhausted: OOM when allocating tensor with shape[1,64,518,518] and type float on /job:localhost/replica:0/task:0/device:GPU:0 by allocator GPU_0_bfc
     [[{{node generator_A_2/G_logit/conv2d/Conv2D-0-TransposeNHWCToNCHW-LayoutOptimizer}}]]
Hint: If you want to see a list of allocated tensors when OOM happens, add report_tensor_allocations_upon_oom to RunOptions for current allocation info.

0 successful operations.
0 derived errors ignored.
ofirkris commented 5 years ago

Same issue here with V100 16GB GPU

Trueyellow commented 5 years ago

It's just Out Of Memory of your GPU. You should modified the model to reduce memory (GPU) costs.

ilovefuju commented 4 years ago

The code read all of the dataset once, so the memory costs very high. You can use light version of UGATIT as the README file said or use another GPU with high memory.

tankfly2014 commented 4 years ago

16GB GPU is dead ? kill me please.