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

example error #18

Open
mohamad-hasan-sohan-ajini opened this issue Jul 6, 2018 · 6 comments
Open

example error #18

mohamad-hasan-sohan-ajini opened this issue Jul 6, 2018 · 6 comments

Comments

@mohamad-hasan-sohan-ajini
Copy link

mohamad-hasan-sohan-ajini commented Jul 6, 2018

Hi
I run test_image.py and get the following error:

/home/aj/repo/DFace/dface/core/models.py:8: UserWarning: nn.init.xavier_uniform is now deprecated in favor of nn.init.xavier_uniform_.
nn.init.xavier_uniform(m.weight.data)
/home/aj/repo/DFace/dface/core/models.py:9: UserWarning: nn.init.constant is now deprecated in favor of nn.init.constant_.
nn.init.constant(m.bias, 0.1)
Traceback (most recent call last):
File "test_image.py", line 18, in
bboxs, landmarks = mtcnn_detector.detect_face(img)
File "/home/aj/repo/DFace/dface/core/detect.py", line 622, in detect_face
boxes, boxes_align = self.detect_rnet(img, boxes_align)
File "/home/aj/repo/DFace/dface/core/detect.py", line 391, in detect_rnet
tmp = np.zeros((tmph[i], tmpw[i], 3), dtype=np.uint8)
ValueError: negative dimensions are not allowed

I use pytorch .4 and python 3.5

@kuaikuaikim
Copy link
Owner

@Hajix please use python2.7 and the pytorch version less than 0.3, i did not test for python3 before.

@thnkim
Copy link

thnkim commented Sep 8, 2018

@kuaikuaikim Hello, I have the same issue although I tried it using python 2.7.15 and pytorch 0.2.0+0b92e5c.

@rohith14
Copy link

@kuaikuaikim and @Hajix : I am running into the same issue. Any update? Thanks

@hanson-young
Copy link

Recently, I also encountered the same problem. I compared it with the tensorflow version of mtnnn.I found that there is a problem in the preprocessing of the network. The image needs to be multiplied by 1/255, but Dface is not. When you test, go to view and confirm the input image tensor @kuaikuaikim @Hajix

@AngelaDevHao
Copy link

AngelaDevHao commented Mar 14, 2019

Recently, I also encountered the same problem. I compared it with the tensorflow version of mtnnn.I found that there is a problem in the preprocessing of the network. The image needs to be multiplied by 1/255, but Dface is not. When you test, go to view and confirm the input image tensor @kuaikuaikim @Hajix

Did you run the demo successfully? I found the reg output by PNet are too large, which results in this error. I try to add the 1/255 preprocess, but it didn't work. Do you have some advice? @kuaikuaikim @hanson-young

@leadcain
Copy link

remove python2.7 pickle

redefine pickle as below:
import six; from six.moves import cPickle as pickle

and modify the code as below:
with open(det_boxs_file, "rb") as file:
det_boxes = pickle.Unpickler(file).load()

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

7 participants