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

TypeError: 'NoneType' object has no attribute '__getitem__' #592

Closed
xinxliu opened this issue Mar 11, 2019 · 1 comment
Closed

TypeError: 'NoneType' object has no attribute '__getitem__' #592

xinxliu opened this issue Mar 11, 2019 · 1 comment

Comments

@xinxliu
Copy link

xinxliu commented Mar 11, 2019

Platform information:

  • Python 2.7
  • MXNet 1.4

Hi, I met the following error when I ran the train.py under insightface/recognition. I am sure I use the recommended dataset MS1M-ArcFace from the baidu source.

Traceback (most recent call last):
File "train.py", line 366, in
main()
File "train.py", line 363, in main
train_net(args)
File "train.py", line 231, in train_net
images_filter = config.data_images_filter,
File "/home/liuxx/work/insightface/recognition/image_iter.py", line 42, in init
header, _ = recordio.unpack(s)
File "/home/liuxx/anaconda2/envs/mxnet/lib/python2.7/site-packages/mxnet/recordio.py", line 416, in unpack
header = IRHeader(*struct.unpack(_IR_FORMAT, s[:_IR_SIZE]))
TypeError: 'NoneType' object has no attribute 'getitem'

Then I manually load the dataset:
>>> imgrec = mx.recordio.MXIndexedRecordIO('datasets/faces_emore/train.idx', 'datasets/faces_emore/train.rec', 'r')
>>> s = imgrec.read_idx(0)
>>>s is None
True

The result of s is None is True. Hence is there something wrong with the dataset?

@xinxliu
Copy link
Author

xinxliu commented Mar 12, 2019

Now I know what's wrong. Unzipping the .zip file under Ubuntu may cause CRC error when the zipped file is larger than 4GB. Unzipping it under Windows can solve this.

@xinxliu xinxliu closed this as completed Mar 12, 2019
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

1 participant