FaceDetection-DSFD icon indicating copy to clipboard operation
FaceDetection-DSFD copied to clipboard

TypeError: forward() missing 1 required positional argument: 'x'

Open berkanttubi opened this issue 3 years ago • 5 comments

Any solution ??

berkanttubi avatar Sep 19 '21 21:09 berkanttubi

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'

berkanttubi avatar Sep 19 '21 22:09 berkanttubi

Hello! Have you solved it? If it is solved, can you please tell me how to solve it? I also encountered such problems

liangpeng97 avatar May 10 '22 14:05 liangpeng97

@liangpeng97 I do not remember clearly now, but the problem was the torch version I think. The code is not working with the new versions of the pytorch

berkanttubi avatar May 11 '22 08:05 berkanttubi

@berkanttubi Thanks

liangpeng97 avatar May 11 '22 08:05 liangpeng97

Hi! I am facing the same problem , does anyone have updated the code to be able to run on new PyTorch versions ?

gkrisp98 avatar Mar 14 '23 07:03 gkrisp98