Closed ahmedmazari-dhatim closed 7 years ago
Did you figure it out yet? I am having the same issue.
@abhiML , hi not yet l'm still struggling to solve it.
Did you build the lmdb file following the original guide?
@abhiML , are you talking about Create a new LMDB dataset. A python program is provided in tool/create_dataset.py. Refer to the function createDataset for details (need to pip install lmdb first). yes l did this
Okay. Could you tell me what exactly is this program convert_dataset.py trying to achieve?
@abhiML , l'm asking the same question. But l think we can train crnn_main.py with the outpouts of create_datasset.py
@abhiML , see #17
@abhiML convert_dataset.py
is only for user who wants to trained with varied image size. For training with fixed size image such as 100x32, only use create_dataset.py
.
@meijieru , thanks for answering. My dataset contains images of varied size. This is why l want to use convert_dataset.py
but l get the following error :
AttributeError: 'lmdbDataset' object has no attribute 'getLabel'
Okay but now I am another error
Traceback (most recent call last): File "crnn_main.py", line 200, in <module> cost = trainBatch(crnn, criterion, optimizer) File "crnn_main.py", line 183, in trainBatch preds = crnn(image) File "/home/ubuntu/anaconda/lib/python2.7/site-packages/torch/nn/modules/module.py", line 206, in __call__ result = self.forward(*input, **kwargs) File "/home/ubuntu/crnn.pytorch/models/crnn.py", line 81, in forward assert h == 1, "the height of conv must be 1" AssertionError: the height of conv must be 1
did you come across this?
@abhiML , have you succeded to run crnn_main.py
? please see #17
No I haven't succeeded in running crnn_main.py
no l mean you succeed some lines of code. you got an error at line 200
but me l got an error atline 18
l did the following :
parser = argparse.ArgumentParser()
parser.add_argument('/home/ahmed/Downloads/sample/output/train', required=True, help='path to dataset')
parser.add_argument('/home/ahmed/Downloads/sample/output/test', required=True, help='path to dataset')
then l run :
python2 crnn_main.py [--param home/ahmed/Downloads/sample/output/train /home/ahmed/Downloads/sample/output/test]
@abhiML , in that way you run your code ?
well i run it using this statement
python crnn_main.py --trainroot="/home/ubuntu/mnt" --valroot="/home/ubuntu/mnt/ramdisk" --cuda
and in your mnt
you have only data-train.mdb & lock-train.mdb
and inramdisk
you have data-valid.mdb & lock-train.mdb ?
@abhiML ,
l run it as follow :
python2 crnn_main.py --trainroot="/home/ahmed/Downloads/training_data/output/train" --valroot="/home/ahmed/Downloads/training_data/output/test" --cuda
l got the following error stating no file directory :
Namespace(Diters=5, adadelta=False, adam=False, alphabet='0123456789abcdefghijklmnopqrstuvwxyz', batchSize=64, beta1=0.5, crnn='', cuda=True, displayInterval=500, experiment=None, imgH=64, keep_ratio=False, lr=1, n_test_disp=10, ngpu=1, nh=100, niter=25, random_sample=False, saveInterval=500, trainroot='/home/ahmed/Downloads/training_data/output/train', valInterval=500, valroot='/home/ahmed/Downloads/training_data/output/test', workers=2)
Random Seed: 9252
Traceback (most recent call last):
File "crnn_main.py", line 59, in <module>
train_dataset = dataset.lmdbDataset(root=opt.trainroot)
File "/home/ahmed/crnn/dataset.py", line 25, in __init__
meminit=False)
lmdb.Error: /home/ahmed/Downloads/training_data/output/train: No such file or directory
what is train? a folder or a file? And the second one is the validation set not the test set.
in your case train should be a folder. Not a file. Inside train your data.mdb and lock.mdb must be present.
train is a folder that contains data.mdb and lock.mdb test is a floder that contains data.mdb and lock.mdb
l just named it test rather than valid. it was not working because l renamed the files data.mdb to data-train.mdb
@abhiML , Now we have the same error :
Traceback (most recent call last):
File "crnn_main.py", line 201, in <module>
cost = trainBatch(crnn, criterion, optimizer)
File "crnn_main.py", line 184, in trainBatch
preds = crnn(image)
File "/home/ahmed/anaconda3/envs/cv/lib/python2.7/site-packages/torch/nn/modules/module.py", line 206, in __call__
result = self.forward(*input, **kwargs)
File "/home/ahmed/crnn/models/crnn.py", line 80, in forward
assert h == 1, "the height of conv must be 1"
AssertionError: the height of conv must be 1
Hello, when l run
convert_dataset.py
l get the following error :indeed, in
dataset.py
there is nogetLabel
How to fix that ?