Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SOLVED] How to Implement DSFD on Windows, Mac, and Linux #79

Open
david-littlefield opened this issue Nov 9, 2020 · 9 comments
Open

Comments

@david-littlefield
Copy link

david-littlefield commented Nov 9, 2020

Here's an article I wrote that shows how to get the demo working on Windows, Mac, and Linux

@berkanttubi
Copy link

Thank you so much david, however I faced anouther error too. Can you have any solution about it?

test_oneimage()
  File "/home/berkanttugberk/GithubProjects/FaceDetection-DSFD/demo.py", line 190, in test_oneimage
    det0 = infer(net , img , transform , thresh , cuda , shrink)
  File "/home/berkanttugberk/GithubProjects/FaceDetection-DSFD/demo.py", line 71, in infer
    y = net(x)      # forward pass
  File "/home/berkanttugberk/miniconda3/lib/python3.9/site-packages/torch/nn/modules/module.py", line 727, in _call
_impl
    result = self.forward(*input, **kwargs)
TypeError: forward() missing 1 required positional argument: 'x'

@david-littlefield
Copy link
Author

Hi-there @berkanttubi. Is that the entire error message?

@berkanttubi
Copy link

Hi-there @berkanttubi. Is that the entire error message?

Here is the entire message;
image

@david-littlefield
Copy link
Author

david-littlefield commented Sep 20, 2021

@berkanttubi You will need to make the changes that are covered in the article to prevent these errors.

@berkanttubi
Copy link

@david-littlefield I did :)

@david-littlefield
Copy link
Author

david-littlefield commented Sep 23, 2021

Screen Shot 2021-09-23 at 12 57 18 AM

The first step in the "Fix the Errors" section should solve this problem.

Can you send a screenshot of your code from the stated files at the stated lines of code?

@berkanttubi
Copy link

@david-littlefield I think the problem was about the torch version. When I downgraded it, the code worked. Thank you so much for your article David. I couldn't do it without your instructions. But I have another question,
It seems the model is very slow. I tried to work with 30 fps 30 sec video, and it took 280 sec to detect it. Isn't it a bit slow? What should fps be, any idea?

@david-littlefield
Copy link
Author

@berkanttubi Good. Glad you were able to get it working! I've only used DSFD with single images, but I vaguely remember the paper stating something about the model not being fast enough to handle live video. What kind of GPU are you using?

@afnan-shazab
Copy link

im getting the following error
loading pretrained resnet model
Finished loading model!
Error bbox number to filter : 0, bbox number: 0
Finished loading data
loading pretrained resnet model
Finished loading model!
Traceback (most recent call last):
File "demo.py", line 232, in
test_oneimage()
File "demo.py", line 201, in test_oneimage
det0 = infer(net , img , transform , thresh , cuda , shrink)
File "demo.py", line 80, in infer
y = net(x) # forward pass
File "/home/shazab/miniconda3/envs/dsfd/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
return forward_call(*input, **kwargs)
File "/home/shazab/FaceDetection-DSFD/face_ssd.py", line 348, in forward
output = self.detect.forward(
File "/home/shazab/FaceDetection-DSFD/layers/functions/detection.py", line 75, in forward
ids, count = nms(boxes, scores, self.nms_thresh, self.top_k)
File "/home/shazab/FaceDetection-DSFD/layers/box_utils.py", line 369, in nms
union = (rem_areas - inter) + area[i]
RuntimeError: The size of tensor a (4999) must match the size of tensor b (0) at non-singleton dimension 0

i dont know what to do

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants