Я пытаюсь обучить модель с моим GTX 1080Ti, которая имеет 11 ГБ памяти, но кажется, что Pytorch зарезервировал около 8 ГБ памяти для себя, каким образом я могу уменьшить это число? (Супер новый для этого)
RuntimeError: CUDA out of memory. Tried to allocate 2.53 GiB (GPU 0; 10.91 GiB total capacity; 4.15 GiB already allocated; 1.73 GiB free; 8.19 GiB reserved in total by PyTorch) (malloc at /pytorch/c10/cuda/CUDACachingAllocator.cpp:289)
frame #0: c10::Error::Error(c10::SourceLocation, std::string const&) + 0x46 (0x7f54646f7536 in /home/yasin/.local/lib/python3.6/site-packages/torch/lib/libc10.so)
frame #1: <unknown function> + 0x1cf1e (0x7f5464940f1e in /home/yasin/.local/lib/python3.6/site-packages/torch/lib/libc10_cuda.so)
frame #2: <unknown function> + 0x1df9e (0x7f5464941f9e in /home/yasin/.local/lib/python3.6/site-packages/torch/lib/libc10_cuda.so)
frame #3: at::native::empty_cuda(c10::ArrayRef<long>, c10::TensorOptions const&, c10::optional<c10::MemoryFormat>) + 0x135 (0x7f54005f7535 in /home/yasin/.local/lib/python3.6/site-packages/torch/lib/libtorch_cuda.so)
frame #4: <unknown function> + 0xf7a66b (0x7f53febef66b in /home/yasin/.local/lib/python3.6/site-packages/torch/lib/libtorch_cuda.so)
frame #5: <unknown function> + 0xfc3f57 (0x7f53fec38f57 in /home/yasin/.local/lib/python3.6/site-packages/torch/lib/libtorch_cuda.so)
frame #6: <unknown function> + 0x1075389 (0x7f543b173389 in /home/yasin/.local/lib/python3.6/site-packages/torch/lib/libtorch_cpu.so)
frame #7: <unknown function> + 0x10756c7 (0x7f543b1736c7 in /home/yasin/.local/lib/python3.6/site-packages/torch/lib/libtorch_cpu.so)
frame #8: <unknown function> + 0xf1557e (0x7f53feb8a57e in /home/yasin/.local/lib/python3.6/site-packages/torch/lib/libtorch_cuda.so)
frame #9: <unknown function> + 0xf18043 (0x7f53feb8d043 in /home/yasin/.local/lib/python3.6/site-packages/torch/lib/libtorch_cuda.so)
frame #10: at::native::cudnn_convolution_backward_input(c10::ArrayRef<long>, at::Tensor const&, at::Tensor const&, c10::ArrayRef<long>, c10::ArrayRef<long>, c10::ArrayRef<long>, long, bool, bool) + 0xb2 (0x7f53feb8d882 in /home/yasin/.local/lib/python3.6/site-packages/torch/lib/libtorch_cuda.so)
frame #11: <unknown function> + 0xf7f3a0 (0x7f53febf43a0 in /home/yasin/.local/lib/python3.6/site-packages/torch/lib/libtorch_cuda.so)
frame #12: <unknown function> + 0xfc3c38 (0x7f53fec38c38 in /home/yasin/.local/lib/python3.6/site-packages/torch/lib/libtorch_cuda.so)
frame #13: at::native::cudnn_convolution_backward(at::Tensor const&, at::Tensor const&, at::Tensor const&, c10::ArrayRef<long>, c10::ArrayRef<long>, c10::ArrayRef<long>, long, bool, bool, std::array<bool, 2ul>) + 0x4fa (0x7f53feb8ef1a in /home/yasin/.local/lib/python3.6/site-packages/torch/lib/libtorch_cuda.so)
frame #14: <unknown function> + 0xf7f6cb (0x7f53febf46cb in /home/yasin/.local/lib/python3.6/site-packages/torch/lib/libtorch_cuda.so)
frame #15: <unknown function> + 0xfc3c94 (0x7f53fec38c94 in /home/yasin/.local/lib/python3.6/site-packages/torch/lib/libtorch_cuda.so)
frame #16: <unknown function> + 0x2c809b6 (0x7f543cd7e9b6 in /home/yasin/.local/lib/python3.6/site-packages/torch/lib/libtorch_cpu.so)
frame #17: <unknown function> + 0x2cd0444 (0x7f543cdce444 in /home/yasin/.local/lib/python3.6/site-packages/torch/lib/libtorch_cpu.so)
frame #18: torch::autograd::generated::CudnnConvolutionBackward::apply(std::vector<at::Tensor, std::allocator<at::Tensor> >&&) + 0x378 (0x7f543c996918 in /home/yasin/.local/lib/python3.6/site-packages/torch/lib/libtorch_cpu.so)
frame #19: <unknown function> + 0x2d89c05 (0x7f543ce87c05 in /home/yasin/.local/lib/python3.6/site-packages/torch/lib/libtorch_cpu.so)
frame #20: torch::autograd::Engine::evaluate_function(std::shared_ptr<torch::autograd::GraphTask>&, torch::autograd::Node*, torch::autograd::InputBuffer&) + 0x16f3 (0x7f543ce84f03 in /home/yasin/.local/lib/python3.6/site-packages/torch/lib/libtorch_cpu.so)
frame #21: torch::autograd::Engine::thread_main(std::shared_ptr<torch::autograd::GraphTask> const&, bool) + 0x3d2 (0x7f543ce85ce2 in /home/yasin/.local/lib/python3.6/site-packages/torch/lib/libtorch_cpu.so)
frame #22: torch::autograd::Engine::thread_init(int) + 0x39 (0x7f543ce7e359 in /home/yasin/.local/lib/python3.6/site-packages/torch/lib/libtorch_cpu.so)
frame #23: torch::autograd::python::PythonEngine::thread_init(int) + 0x38 (0x7f545f97b4d8 in /home/yasin/.local/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
frame #24: <unknown function> + 0xbd6df (0x7f54675c86df in /usr/lib/x86_64-linux-gnu/libstdc++.so.6)
frame #25: <unknown function> + 0x76db (0x7f546c2ff6db in /lib/x86_64-linux-gnu/libpthread.so.0)
frame #26: clone + 0x3f (0x7f546c63888f in /lib/x86_64-linux-gnu/libc.so.6)
Супер разрешение с CNN и GAN
train_cnn.py