clovaai / deep-text-recognition-benchmark

Text recognition (optical character recognition) with deep learning methods, ICCV 2019
Apache License 2.0
3.74k stars 1.1k forks source link

Error when creating my own lmdb dataset #254

Open minhdc opened 3 years ago

minhdc commented 3 years ago

I followed the instruction of how to create your own lmdb dataset in README, but the following error occured:

`Traceback (most recent call last):

File "create_lmdb_dataset.py", line 88, in fire.Fire(createDataset)

File "/home/extreme45nm/anaconda3/lib/python3.7/site-packages/fire/core.py", line 138, in Fire component_trace = _Fire(component, args, parsed_flag_args, context, name)

File "/home/extreme45nm/anaconda3/lib/python3.7/site-packages/fire/core.py", line 468, in _Fire target=component.name)

File "/home/extreme45nm/anaconda3/lib/python3.7/site-packages/fire/core.py", line 672, in _CallAndUpdateTrace component = fn(*varargs, **kwargs)

File "create_lmdb_dataset.py", line 48, in createDataset imagePath, label = datalist[i].strip('\n').split('\t')

ValueError: not enough values to unpack (expected 2, got 1) `

minhdc commented 3 years ago

It seems that there may be a problem in assigning imagePath and label. So I modified the code in create_lmdb_dataset.py as following:

Before: imagePath, label = datalist[i].strip('\n').split('\t')

After: imagePath = datalist[i].strip('\n').split('\t')[0] label = datalist[i].strip('\n').split('\t')[1] `

And I was be able to create my own lmdb dataset.

shinsjn commented 2 years ago

I have a same problem. i have a change '\t' -> ' '