Comments (2)
Hi
I am trying your code on a group photo with approximately 90 faces in it. I am getting the following CUDA error...RuntimeError: CUDA out of memory. Tried to allocate 6.27 GiB (GPU 0; 8.00 GiB total capacity; 7.82 GiB already allocated; 0 bytes free; 7.83 GiB reserved in total by PyTorch)
Is there a flag that will allow me to run with my RTX 2070 SUPER card (8GB dedicated GPU memory, 8GB shared GPU memory)? I noticed for another question about CUDA, you referred the questioner to https://github.com/rosinality/stylegan2-pytorch.
I looked at that repo and saw for a CUDA memory issue, they recommended to usetorch.no_grad
. Will that help here, and if so, how should that be done?Any help would be appreciated!
Thanks!
See torch.no_grad
in face_model/face_gan.py.
Face detection could be memory-consuming too. Please check out if this issue is caused by face detection or GPEN?
from gpen.
Thanks for getting back with me! From your response, I understand that you are already using the torch.no_grad
capability. Here is the full error traceback that I get.
(FullSubNet) F:\GPEN-main\GPEN-main>python face_enhancement.py
Traceback (most recent call last):
File "face_enhancement.py", line 100, in <module>
img, orig_faces, enhanced_faces = faceenhancer.process(im)
File "face_enhancement.py", line 43, in process
facebs, landms = self.facedetector.detect(img)
File "F:\GPEN-main\GPEN-main\retinaface\retinaface_detection.py", line 67, in detect
loc, conf, landms = self.net(img) # forward pass
File "C:\Users\Steve\anaconda3\envs\FullSubNet\lib\site-packages\torch\nn\modules\module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "F:\GPEN-main\GPEN-main\retinaface\facemodels\retinaface.py", line 108, in forward
out = self.body(inputs)
File "C:\Users\Steve\anaconda3\envs\FullSubNet\lib\site-packages\torch\nn\modules\module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "C:\Users\Steve\anaconda3\envs\FullSubNet\lib\site-packages\torchvision\models\_utils.py", line 63, in forward
x = module(x)
File "C:\Users\Steve\anaconda3\envs\FullSubNet\lib\site-packages\torch\nn\modules\module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "C:\Users\Steve\anaconda3\envs\FullSubNet\lib\site-packages\torch\nn\modules\batchnorm.py", line 131, in forward
return F.batch_norm(
File "C:\Users\Steve\anaconda3\envs\FullSubNet\lib\site-packages\torch\nn\functional.py", line 2056, in batch_norm
return torch.batch_norm(
RuntimeError: CUDA out of memory. Tried to allocate 6.27 GiB (GPU 0; 8.00 GiB total capacity; 7.82 GiB already allocated; 0 bytes free; 7.83 GiB reserved in total by PyTorch)
(FullSubNet) F:\GPEN-main\GPEN-main>
I found that if I process only about a third of the original photo, then GPEN has no trouble. So I've cropped the large photo into three separate photos, processed each by GPEN, and combined the separate outputs to get all the processed faces in one result. However, a few faces had to be cut off, so I would prefer not having to piece together the separate processed photos by hand.
from gpen.
Related Issues (20)
- SyntaxWarning: "is" with a literal
- How to Prepare the Inpainting Training Dataset
- Inconsistencies with original paper. HOT 1
- Gpen
- why do you blur twice with the same guassian kernel?
- Training the Inpainting model
- Can it work on RGBA images?
- Have you tried with your FullGenerator_SR model?
- Confusing in the umeyama implementation. HOT 1
- Can't manage to find a download link for GPEN-BFR-2048 model. HOT 2
- about automatically rotated
- About the input resolution of "net_d.pt"
- TensorRT deployment HOT 3
- 部分人脸会出现磨皮很严重和人脸凭空出现黑痣的现象,有解决思路吗 HOT 1
- Unclear step (run codes) HOT 2
- 你好,发布一个可微调的GPEN-BFR-512模型吗?
- FullGenerator_SR
- eval lpips HOT 4
- Training results are normal, but test results abnormality HOT 1
- from face_detect.retinaface_detection import RetinaFaceDetection ModuleNotFoundError: No module named 'face_detect'
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gpen.