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

errors #3

Closed
Hucley opened this issue Oct 16, 2017 · 4 comments
Closed

errors #3

Hucley opened this issue Oct 16, 2017 · 4 comments

Comments

@Hucley
Copy link

Hucley commented Oct 16, 2017

parser.add_argument('--dataset', default='../../dataset/face/casia/casia.zip', type=str)
Place the original casia.zip in the above place,and the rest of the region has not changed.
There are still some errors during run time:

File "/home//PycharmProjects/sphereface/dataset.py", line 39, in dataset_handle
data = callback(name,filename,pindex,cacheobj,zfile)
File "/home/
/PycharmProjects/sphereface/train.py", line 56, in dataset_load
data = np.frombuffer(zfile.read(nameinzip),np.uint8)
File "/home//anaconda3/lib/python3.5/zipfile.py", line 1232, in read
with self.open(name, "r", pwd) as fp:
File "/home/
/anaconda3/lib/python3.5/zipfile.py", line 1255, in open
zinfo = self.getinfo(name)
File "/home/***/anaconda3/lib/python3.5/zipfile.py", line 1199, in getinfo
'There is no item named %r in the archive' % name)
KeyError: "There is no item named '0348347/018.jpg' in the archive"

@clcarwin
Copy link
Owner

I use the cleaned casia version. You can find the version from FaceVerification.

You'd better to check if any parent directory is before path '0348347/018.jpg', such as 'xxx/0348347/018.jpg'. If so, modify this line zfile.read(nameinzip) to zfile.read('xxx/'+nameinzip).

@Hucley
Copy link
Author

Hucley commented Oct 19, 2017

Thanks, using the 'zfile.read('xxx/'+nameinzip)' with python2.7 is ok in this unit. but then there was another mistake:
Traceback (most recent call last):
File "/home//PycharmProjects/sphereface2/train.py", line 141, in
train(epoch,args)
File "/home/
/PycharmProjects/sphereface2/train.py", line 110, in train
outputs = net(inputs)
File "/home//anaconda2/lib/python2.7/site-packages/torch/nn/modules/module.py", line 206, in call
result = self.forward(input, kwargs)
File "/home/
/PycharmProjects/sphereface2/net_sphere.py", line 175, in forward
x = self.fc6(x)
File "/home/
/anaconda2/lib/python2.7/site-packages/torch/nn/modules/module.py", line 206, in call
result = self.forward(input, kwargs)
File "/home/
/PycharmProjects/sphereface2/net_sphere.py", line 40, in forward
cos_theta = cos_theta / xlen.view(-1,1) / wlen.view(1,-1)
File "/home//anaconda2/lib/python2.7/site-packages/torch/autograd/variable.py", line 785, in div
return self.div(other)
File "/home/
/anaconda2/lib/python2.7/site-packages/torch/autograd/variable.py", line 315, in div
return Div()(self, other)
File "/home/***/anaconda2/lib/python2.7/site-packages/torch/autograd/_functions/basic_ops.py", line 57, in forward
return a.div(b)
RuntimeError: sizes do not match at /opt/conda/conda-bld/pytorch_1501972792122/work/pytorch-0.1.12/torch/lib/THC/generated/../generic/THCTensorMathPointwise.cu:344

@clcarwin
Copy link
Owner

The pytorch may be too old to work. Please update it to the latest version 0.2.x.

@zhangweiyi258
Copy link

I use the cleaned casia version. You can find the version from FaceVerification.

You'd better to check if any parent directory is before path '0348347/018.jpg', such as 'xxx/0348347/018.jpg'. If so, modify this line zfile.read(nameinzip) to zfile.read('xxx/'+nameinzip).

where is the line 'zfile.read(nameinzip)'? thx!

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