Comments (10)
Hi, try to add torch.set_grad_enabled(False)
inside test_oneimage() function (at the beginning of the function) if your torch version is >= 0.4. It works for me.
from facedetection-dsfd.
Hi @cqlyiyeshu
I think that 16G is enough.
you can try to use less scale in demo.py. especially for 2x.
from facedetection-dsfd.
Hi @cqlyiyeshu
I think that 16G is enough.
you can try to use less scale in demo.py. especially for 2x.@lijiannuist Do you mean resizing the input image to a smaller size?
yes,i resize as 100x100
from facedetection-dsfd.
Hi @AmitRozner
Of course. But Training with smaller batch size may reduce detection performance slightly.
from facedetection-dsfd.
My gpu is V100, 16G, when I run
python demo.py --trained_model weights/WIDERFace_DSFD_RES152.pth --img_root data/worlds-largest-selfie.jpg
It gets error: RuntimeError: CUDA out of memory
Is it possible to use smaller GPU?
from facedetection-dsfd.
@lijiannuist My gpu is 8G,how can i solve the error "RuntimeError: CUDA out of memory "?
error log is:
traceback (most recent call last):
File "demo.py", line 248, in
test_oneimage()
File "demo.py", line 232, in test_oneimage
det_b = np.row_stack((det_b, infer(net , img , transform , thresh , cuda , bt)))
File "demo.py", line 98, in infer
y = net(x) # forward pass
File "/usr/lib64/python2.7/site-packages/torch/nn/modules/module.py", line 477, in call
result = self.forward(*input, **kwargs)
File "/home/jy/FaceDetection-DSFD/face_ssd.py", line 235, in forward
conv4_3_x = self.layer2(conv3_3_x)
File "/usr/lib64/python2.7/site-packages/torch/nn/modules/module.py", line 477, in call
result = self.forward(*input, **kwargs)
File "/usr/lib64/python2.7/site-packages/torch/nn/modules/container.py", line 91, in forward
input = module(input)
File "/usr/lib64/python2.7/site-packages/torch/nn/modules/module.py", line 477, in call
result = self.forward(*input, **kwargs)
File "/usr/lib64/python2.7/site-packages/torch/nn/modules/container.py", line 91, in forward
input = module(input)
File "/usr/lib64/python2.7/site-packages/torch/nn/modules/module.py", line 477, in call
result = self.forward(*input, **kwargs)
File "/usr/lib/python2.7/site-packages/torchvision/models/resnet.py", line 85, in forward
out = self.bn3(out)
File "/usr/lib64/python2.7/site-packages/torch/nn/modules/module.py", line 477, in call
result = self.forward(*input, **kwargs)
File "/usr/lib64/python2.7/site-packages/torch/nn/modules/batchnorm.py", line 66, in forward
exponential_average_factor, self.eps)
File "/usr/lib64/python2.7/site-packages/torch/nn/functional.py", line 1254, in batch_norm
training, momentum, eps, torch.backends.cudnn.enabled
RuntimeError: CUDA error: out of memory
from facedetection-dsfd.
Hi @cqlyiyeshu
I think that 16G is enough.
you can try to use less scale in demo.py. especially for 2x.
@lijiannuist Do you mean resizing the input image to a smaller size?
from facedetection-dsfd.
You can use this https://github.com/vlad3996/FaceDetection-DSFD with original author's checkpoint
or try at least
with torch.no_grad():
to inference
from facedetection-dsfd.
My gpu is V100, 16G, when I run
python demo.py --trained_model weights/WIDERFace_DSFD_RES152.pth --img_root data/worlds-largest-selfie.jpg
It gets error: RuntimeError: CUDA out of memory
Is it possible to use smaller GPU?
应该用的是0.4+的torch吧,内存没有释放,用0.3的torch就没问题了
from facedetection-dsfd.
My gpu is V100, 16G, when I run
python demo.py --trained_model weights/WIDERFace_DSFD_RES152.pth --img_root data/worlds-largest-selfie.jpg
It gets error: RuntimeError: CUDA out of memory
Is it possible to use smaller GPU?
应该用的是0.4+的torch吧,内存没有释放,用0.3的torch就没问题了
用0.4+的torch确实会报内存不够,请问有什么方法可以释放内存嘛?我现在只能一张图片一张图片地测。
from facedetection-dsfd.
Related Issues (20)
- how about the eval_tools? HOT 1
- Add 'configuration' files to install requirements easily
- TypeError: mul(): The parameter'other' (position 1) must be Tensor, not numpy.ndarray
- Excuse me, how to train the network? I don't seem to see the code about the training model
- How can we use webcam to test our DSFD model.
- FileNotFoundError: [Errno 2] No such file or directory: '/data/wider_face_split\\wider_face_val.mat' HOT 2
- [SOLVED] How to Implement DSFD on Windows, Mac, and Linux HOT 9
- [SOLVED] How to Implement DSFD on Windows, Mac, and Linux
- RandomBaiduCrop
- How do I test multiple images using Demo.py HOT 1
- TypeError: can't convert cuda:0 device type tensor to numpy. HOT 1
- Error in running demo.py
- demo.py RuntimeError: Legacy autograd function with non-static forward method is deprecated. HOT 2
- TypeError: forward() missing 1 required positional argument: 'x' HOT 5
- How do I test the video in the demo.py?
- GPU out of memory HOT 1
- Fix RuntimeError: Legacy autograd function with non-static forward method is deprecated
- training code
- Legacy autograd function with non-static forward method is deprecated.
- 论文里SSL损失函数公式最外面那个括号是不是放错位置了
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 facedetection-dsfd.