bes-dev / crnn-pytorch

Pytorch implementation of OCR system using CRNN + CTCLoss
BSD 2-Clause "Simplified" License
217 stars 55 forks source link

About default training with test dataset generator #3

Closed jing-bi closed 6 years ago

jing-bi commented 6 years ago

when I use test dataset generator, I think I should return some training data, but how can I use is for train, cause in train.py I found that you use generated data with method "set_mode" which doesn't have definition in test_data.py here is error report: (dip) crnn-pytorch-master python3 train.py --test-init True --test-epoch 10 --output-dir ./snap testdata Test phase Traceback (most recent call last): File "train.py", line 143, in main() File "/Users/jing/anaconda3/envs/dip/lib/python3.6/site-packages/click/core.py", line 722, in call return self.main(args, kwargs) File "/Users/jing/anaconda3/envs/dip/lib/python3.6/site-packages/click/core.py", line 697, in main rv = self.invoke(ctx) File "/Users/jing/anaconda3/envs/dip/lib/python3.6/site-packages/click/core.py", line 895, in invoke return ctx.invoke(self.callback, ctx.params) File "/Users/jing/anaconda3/envs/dip/lib/python3.6/site-packages/click/core.py", line 535, in invoke return callback(args, **kwargs) File "train.py", line 83, in main data.set_mode('test') TypeError: set_mode() takes 1 positional argument but 2 were given

bes-dev commented 6 years ago

Hi,

So, test_data generate unique (random) sample for each call and it’s not need to use set_mode.

bes-dev commented 6 years ago

Error was fixed