Code Monkey home page Code Monkey logo

Comments (10)

yihongXU avatar yihongXU commented on April 30, 2024 6

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.

lijiannuist avatar lijiannuist commented on April 30, 2024 1

Hi @cqlyiyeshu
I think that 16G is enough.
you can try to use less scale in demo.py. especially for 2x.

from facedetection-dsfd.

jiangziya avatar jiangziya commented on April 30, 2024 1

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.

lijiannuist avatar lijiannuist commented on April 30, 2024

Hi @AmitRozner
Of course. But Training with smaller batch size may reduce detection performance slightly.

from facedetection-dsfd.

cqlyiyeshu avatar cqlyiyeshu commented on April 30, 2024

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.

jiangziya avatar jiangziya commented on April 30, 2024

@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.

JaywongWang avatar JaywongWang commented on April 30, 2024

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.

vlad3996 avatar vlad3996 commented on April 30, 2024

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.

TekiLi avatar TekiLi commented on April 30, 2024

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.

KarelZhang avatar KarelZhang commented on April 30, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.