Closed manhvela closed 2 years ago
Hi! @manhvela , thanks for your interest in the project. It seems that the current config is not compatible with your device. How many GPUs do you have? the default setting is now using 2 GPUs. If you have only one GPU, setting [gpu_ids] to 0 may fix your problem. https://github.com/ligoudaner377/font_translator_gan/blob/9e1aaf03b3edbacee0023607f60cc4b2a155cc8b/options/base_options.py#L24
@ligoudaner377 thank you for the fast reply! I have one GPU (Nvidia GTX 1060). I tried this but a new error came up, something to do with my GPU I guess:
Setting up a new session... create web directory ./checkpoints/test_new_dataset/web... Traceback (most recent call last): File "train.py", line 33, in
model.optimize_parameters() # calculate loss functions, get gradients, update network weights
File "/home/dufra/Desktop/gan/font_translator_gan/models/font_translator_gan_model.py", line 129, in optimize_parameters self.forward() # compute fake images: G(A) File "/home/dufra/Desktop/gan/font_translator_gan/models/font_translator_gan_model.py", line 80, in forward self.generated_images = self.netG((self.content_images, self.style_images)) File "/home/dufra/.local/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl return forward_call(*input, kwargs) File "/home/dufra/.local/lib/python3.8/site-packages/torch/nn/parallel/data_parallel.py", line 166, in forward return self.module(*inputs[0], *kwargs[0]) File "/home/dufra/.local/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl return forward_call(input, kwargs) File "/home/dufra/Desktop/gan/font_translator_gan/models/networks.py", line 952, in forward style_features = self.style_encoder(style_images.view(-1, 1, 64, 64)) File "/home/dufra/.local/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl return forward_call(*input, kwargs) File "/home/dufra/Desktop/gan/font_translator_gan/models/networks.py", line 799, in forward return self.model(inp) File "/home/dufra/.local/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl return forward_call(*input, *kwargs) File "/home/dufra/.local/lib/python3.8/site-packages/torch/nn/modules/container.py", line 141, in forward input = module(input) File "/home/dufra/.local/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl return forward_call(input, kwargs) File "/home/dufra/.local/lib/python3.8/site-packages/torch/nn/modules/batchnorm.py", line 168, in forward return F.batch_norm( File "/home/dufra/.local/lib/python3.8/site-packages/torch/nn/functional.py", line 2282, in batch_norm return torch.batch_norm( RuntimeError: CUDA out of memory. Tried to allocate 1.50 GiB (GPU 0; 5.93 GiB total capacity; 2.57 GiB already allocated; 915.94 MiB free; 3.97 GiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation. See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF
btw I tried to run it in Colab GPU runtime and I get the same error
@manhvela Maybe try a smaller batch size? A large batch size may cause some memory issues. Change this config to adjust it. (start with a small number e.g., 16, 32) https://github.com/ligoudaner377/font_translator_gan/blob/9e1aaf03b3edbacee0023607f60cc4b2a155cc8b/models/font_translator_gan_model.py#L12
@ligoudaner377 it's working, thank you very much!
Hello, amazing job there!
I'm kind of new in deep learning. I tried to run your code but I get this error:
Could you help me?
Thanks