clovaai / deep-text-recognition-benchmark

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

I encountered a bug when executing the following command in the deep-text-recognition-benchmark repository #408

Closed Floracq64 closed 1 year ago

Floracq64 commented 1 year ago

During the execution, the following output and traceback error were observed:

Filtering the images containing characters which are not in opt.character
Filtering the images whose label is longer than opt.batch_max_length

dataset_root: ../
opt.select_data: ['MJ', 'ST']
opt.batch_ratio: ['0.5', '0.5']

Attempting to open LMDB at ../
dataset_root:    ../     dataset: MJ
True
sub-directory:  /MJ      num samples: 159
num total samples of MJ: 159 x 1.0 (total_data_usage_ratio) = 159
num samples of MJ per batch: 192 x 0.5 (batch_ratio) = 96

Attempting to open LMDB at ../
dataset_root:    ../     dataset: ST
True
Traceback (most recent call last):
  File "A:\test\deep-text-recognition-benchmark\train.py", line 317, in <module>
    train(opt)
  File "A:\test\deep-text-recognition-benchmark\train.py", line 31, in train
    train_dataset = Batch_Balanced_Dataset(opt)
  File "A:\test\deep-text-recognition-benchmark\dataset.py", line 42, in __init__
    _dataset, _dataset_log = hierarchical_dataset(root=opt.train_data, opt=opt, select_data=[selected_d])
  File "A:\test\deep-text-recognition-benchmark\dataset.py", line 119, in hierarchical_dataset
    dataset = LmdbDataset(dirpath, opt)
  File "A:\test\deep-text-recognition-benchmark\dataset.py", line 137, in __init__
    self.env = lmdb.open(root, max_readers=32, readonly=True, lock=False, readahead=False, meminit=False)
lmdb.Error: ..//deep-text-recognition-benchmark\saved_models\TPS-ResNet-BiLSTM-Attn-Seed1111: No such file or directory

I have already changed the paths several times without any success. The directory is correctly created, but the error persists. I would appreciate any assistance to resolve this issue.

Steps to Reproduce:

  1. Navigate to the deep-text-recognition-benchmark directory.
  2. Execute the command mentioned above.
  3. Observe the traceback error. Environment:

eep-text-recognition-benchmark version: (e.g., latest from the repository as of date) Additional Context:

I have tried different path configurations, ensuring that the directories exist and are accessible. The saved model path provided in the command is ./saved_models/custom_example.pth. It seems like the program is attempting to access a different path (TPS-ResNet-BiLSTM-Attn-Seed1111) which does not exist, as indicated in the error message.

Seoung-wook commented 11 months ago

The path seems to be wrong. your path: ..//deep-text-recognition-benchmark\saved_models\TPS-ResNet-BiLSTM-Attn-Seed1111

edit .\deep-text-recognition-benchmark\saved_models\TPS-ResNet-BiLSTM-Attn-Seed1111 or .\saved_models\TPS-ResNet-BiLSTM-Attn-Seed1111