clcarwin / sphereface_pytorch

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

dataset problem #11

Open LingJiangXie opened 6 years ago

LingJiangXie commented 6 years ago

Hi ! Thank you for this pytorch version sphereface code ,I have found this for a long time .But when I run train.py ,some problems occured. VisibleDeprecationWarning: using a non-integer number instead of an integer will result in an error in the future nparrimage = np.frombuffer(arrimage.get_obj(),np.float32).reshape(10,len(arrimage)/10) .I think my numpy version(1.11.0) is not fine. 'There is no item named %r in the archive' % name) KeyError: "There is no item named '1212722/038.jpg' in the archive" . But I find this image in the fold 1212722 . Last problem may I get the mtcnn landmarks for casia? or you can tell me mtcnn codes ,I run it.Thank you very much!

LingJiangXie commented 6 years ago

When I changed my python from 3.6 to 2.7 .Problem "VisibleDeprecationWarning: using a non-integer number instead of an integer will result in an error in the future nparrimage = np.frombuffer(arrimage.get_obj(),np.float32).reshape(10,len(arrimage)/10) ." disappeared. And I find the landmarks in the fold (data).But problem some image not found still exists.I thinlk multiprocessing module to read images cause the problem.Can you tell me how to fix it ?

LingJiangXie commented 6 years ago

Process Process-1: Traceback (most recent call last): File "/home/dany/anaconda3/envs/snakes/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap self.run() File "/home/dany/anaconda3/envs/snakes/lib/python2.7/multiprocessing/process.py", line 114, in run self._target(*self._args, *self._kwargs) File "/home/dany/Documents/workspace/sphereface_pytorch-master_2.7/dataset.py", line 38, in dataset_handle data = callback(name,filename,pindex,cacheobj,zfile) File "/home/dany/Documents/workspace/sphereface_pytorch-master_2.7/train.py", line 54, in dataset_load data = np.frombuffer(zfile.read(nameinzip),np.uint8) File "/home/dany/anaconda3/envs/snakes/lib/python2.7/zipfile.py", line 938, in read return self.open(name, "r", pwd).read() File "/home/dany/anaconda3/envs/snakes/lib/python2.7/zipfile.py", line 964, in open zinfo = self.getinfo(name) File "/home/dany/anaconda3/envs/snakes/lib/python2.7/zipfile.py", line 912, in getinfo 'There is no item named %r in the archive' % name) KeyError: "There is no item named '3331486/011.jpg' in the archive" Process Process-2: Traceback (most recent call last): File "/home/dany/anaconda3/envs/snakes/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap self.run() File "/home/dany/anaconda3/envs/snakes/lib/python2.7/multiprocessing/process.py", line 114, in run self._target(self._args, **self._kwargs) File "/home/dany/Documents/workspace/sphereface_pytorch-master_2.7/dataset.py", line 38, in dataset_handle data = callback(name,filename,pindex,cacheobj,zfile) File "/home/dany/Documents/workspace/sphereface_pytorch-master_2.7/train.py", line 54, in dataset_load data = np.frombuffer(zfile.read(nameinzip),np.uint8) File "/home/dany/anaconda3/envs/snakes/lib/python2.7/zipfile.py", line 938, in read return self.open(name, "r", pwd).read() File "/home/dany/anaconda3/envs/snakes/lib/python2.7/zipfile.py", line 964, in open zinfo = self.getinfo(name) File "/home/dany/anaconda3/envs/snakes/lib/python2.7/zipfile.py", line 912, in getinfo 'There is no item named %r in the archive' % name) KeyError: "There is no item named '0235966/005.jpg' in the archive"

lucaskyle commented 6 years ago

plz check the path should be /..../.../lfw.zip/file_name/xxx.jpg

LingJiangXie commented 6 years ago

Yes,I have checked ...

hujuan940506 commented 6 years ago

I have the same problem as LingJiangXie, I want to ask you that your problem has been solved?

Traceback (most recent call last): File "/usr/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap self.run() File "/usr/lib/python2.7/multiprocessing/process.py", line 114, in run self._target(*self._args, **self._kwargs) File "/home/liuyh/IDcar/sphereface_pytorch-master/dataset.py", line 38, in dataset_handle data = callback(name,filename,pindex,cacheobj,zfile) File "train.py", line 59, in dataset_load print(zfile.read('casia/' + nameinzip)) File "/usr/lib/python2.7/zipfile.py", line 935, in read return self.open(name, "r", pwd).read() File "/usr/lib/python2.7/zipfile.py", line 961, in open zinfo = self.getinfo(name) File "/usr/lib/python2.7/zipfile.py", line 909, in getinfo 'There is no item named %r in the archive' % name) KeyError: "There is no item named 'casia/0001392/091.jpg' in the archive"

LingJiangXie commented 6 years ago

Not solved.......

clcarwin commented 6 years ago

Please try to read this issue #3 .

LingJiangXie commented 6 years ago

Thank you !

hujuan940506 commented 6 years ago

@clcarwin Thank you very much!

hujuan940506 commented 6 years ago

Have you solved it now? @LingJiangXie

LingJiangXie commented 6 years ago

Downloading datasets https://pan.baidu.com/s/1i5gX7Dz d31k

dpcross commented 6 years ago

modify zfile.read('nameinzip) to zfile.read('CASIA-WebFace/'+nameinzip) (train.py) add try catch before data = callback(name,filename,pindex,cacheobj,zfile) ,continue except

hujuan940506 commented 6 years ago

@dpcross Thank you very much! I have solved this route problem in your way, but I have encountered this problem:

Traceback (most recent call last): File "train.py", line 162, in train(epoch,args) File "train.py", line 131, in train outputs = net(inputs) File "/usr/local/lib/python2.7/dist-packages/torch/nn/modules/module.py", line 206, in call result = self.forward(*input, *kwargs) File "/home/liuyh/IDcar/sphereface_pytorch-master/net_sphere.py", line 175, in forward x = self.fc6(x) File "/usr/local/lib/python2.7/dist-packages/torch/nn/modules/module.py", line 206, in call result = self.forward(input, **kwargs) File "/home/liuyh/IDcar/sphereface_pytorch-master/net_sphere.py", line 40, in forward cos_theta = cos_theta / xlen.view(-1,1) / wlen.view(1,-1) File "/usr/local/lib/python2.7/dist-packages/torch/autograd/variable.py", line 780, in div return self.div(other) File "/usr/local/lib/python2.7/dist-packages/torch/autograd/variable.py", line 312, in div return Div()(self, other) File "/usr/local/lib/python2.7/dist-packages/torch/autograd/_functions/basic_ops.py", line 57, in forward return a.div(b) RuntimeError: sizes do not match at /b/wheel/pytorch-src/torch/lib/THC/generated/../generic/THCTensorMathPointwise.cu:344

hujuan940506 commented 6 years ago

@LingJiangXie Have you encounter this problem in your trainning process

hujuan940506 commented 6 years ago

@clcarwin Thank you very much! I have solved this problem in your way, update pytorch to version 0.2.x.

sevenHsu commented 6 years ago

I just have the same problem with you guys.And my pytorch version is 0.2.0_3,but it does'nt work.How can i solve this problem?? _Traceback (most recent call last): File "lfw_eval.py", line 102, in img1 = alignment(cv2.imdecode(np.frombuffer(zfile.read(name1),np.uint8),1),landmark[name1]) File "/usr/lib/python3.6/zipfile.py", line 1314, in read with self.open(name, "r", pwd) as fp: File "/usr/lib/python3.6/zipfile.py", line 1352, in open zinfo = self.getinfo(name) File "/usr/lib/python3.6/zipfile.py", line 1281, in getinfo 'There is no item named %r in the archive' % name) KeyError: "There is no item named 'Abel_Pacheco/Abel_Pacheco0001.jpg' in the archive"

lucaskyle commented 6 years ago

just need good washed CASIA.zip dataset.


发件人: Seven.Hsu notifications@github.com 发送时间: 2018年4月1日 12:46 收件人: clcarwin/sphereface_pytorch 抄送: lucaskyle; Comment 主题: Re: [clcarwin/sphereface_pytorch] dataset problem (#11)

I just have the same problem with you guys.And my pytorch version is 0.2.0_3,but it does'nt work.How can i solve this problem?? Traceback (most recent call last): File "lfw_eval.py", line 102, in img1 = alignment(cv2.imdecode(np.frombuffer(zfile.read(name1),np.uint8),1),landmark[name1]) File "/usr/lib/python3.6/zipfile.py", line 1314, in read with self.open(name, "r", pwd) as fp: File "/usr/lib/python3.6/zipfile.py", line 1352, in open zinfo = self.getinfo(name) File "/usr/lib/python3.6/zipfile.py", line 1281, in getinfo 'There is no item named %r in the archive' % name) KeyError: "There is no item named 'Abel_Pacheco/Abel_Pacheco_0001.jpg' in the archive"

― You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/clcarwin/sphereface_pytorch/issues/11#issuecomment-377784440, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AZb9oZoUzHHlo4NOfnRB05LYstkttzv7ks5tkMwIgaJpZM4RMjk7.

sevenHsu commented 6 years ago

Thank you so much.I'll try it in your way.

Sent from my iPhone

On Apr 2, 2018, at 09:41, lucaskyle notifications@github.com wrote:

just need good washed CASIA.zip dataset.


发件人: Seven.Hsu notifications@github.com 发送时间: 2018年4月1日 12:46 收件人: clcarwin/sphereface_pytorch 抄送: lucaskyle; Comment 主题: Re: [clcarwin/sphereface_pytorch] dataset problem (#11)

I just have the same problem with you guys.And my pytorch version is 0.2.0_3,but it does'nt work.How can i solve this problem?? Traceback (most recent call last): File "lfw_eval.py", line 102, in img1 = alignment(cv2.imdecode(np.frombuffer(zfile.read(name1),np.uint8),1),landmark[name1]) File "/usr/lib/python3.6/zipfile.py", line 1314, in read with self.open(name, "r", pwd) as fp: File "/usr/lib/python3.6/zipfile.py", line 1352, in open zinfo = self.getinfo(name) File "/usr/lib/python3.6/zipfile.py", line 1281, in getinfo 'There is no item named %r in the archive' % name) KeyError: "There is no item named 'Abel_Pacheco/Abel_Pacheco_0001.jpg' in the archive"

― You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/clcarwin/sphereface_pytorch/issues/11#issuecomment-377784440, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AZb9oZoUzHHlo4NOfnRB05LYstkttzv7ks5tkMwIgaJpZM4RMjk7. — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

yonger001 commented 6 years ago

hi,guys. when I run the train.py,I got a problem as fllows. KeyError: "There is no item named '1478996/020.jpg' in the archive" then i modified the np.frombuffer(zfile.read(nameinzip),np.uint8) to np.frombuffer(zfile.read(a+nameinzip),np.uint8), a+nameinzip is the absolute path of image,but it didn‘t work. Do you have any idea? thank you so much!waiting for your reply!

netpcvnn commented 5 years ago

Hi @LingJiangXie, Can you upload the washed dataset to other sites? I cannot to download from baidu because we dont have Chinese mobile phone number to activate the account. Thank you!

chenmingjiong commented 5 years ago

Hi @LingJiangXie, Can you upload the washed dataset to other sites? I cannot to download from baidu because we dont have Chinese mobile phone number to activate the account. Thank you!

I have uploaded it to OneDrive: https://1drv.ms/u/s!AjMP8wpvXdkfhMhnmNDEdj5oor7M_A

helang818 commented 2 years ago

hi,guys. when I run the train.py,I got a problem as fllows. KeyError: "There is no item named '1478996/020.jpg' in the archive" then i modified the np.frombuffer(zfile.read(nameinzip),np.uint8) to np.frombuffer(zfile.read(a+nameinzip),np.uint8), a+nameinzip is the absolute path of image,but it didn‘t work. Do you have any idea? thank you so much!waiting for your reply!

have you soved this issue?