clcarwin / sphereface_pytorch

A PyTorch Implementation of SphereFace.
MIT License
715 stars 172 forks source link

errors #3

Closed Hucley closed 7 years ago

Hucley commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

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

zhangweiyi258 commented 5 years ago

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!