meijieru / crnn.pytorch

Convolutional recurrent network in pytorch
MIT License
2.38k stars 658 forks source link

ValueError: sampler option is mutually exclusive with shuffle #139

Open rezha130 opened 6 years ago

rezha130 commented 6 years ago

Hi @meijieru

I try to train with my custom train dataset with command: python train.py --trainroot data/train_lmdb --valroot data/val_lmdb

LMDB file created by using tool/create_dataset.py script.

and i got this error response

Namespace(adadelta=False, adam=False, alphabet='0123456789abcdefghijklmnopqrstuvwxyz', batchSize=64, beta1=0.5, crnn='', cuda=False, displayInterval=500, experiment=None, imgH=32, imgW=100, keep_ratio=False, lr=0.01, n_test_disp=10, ngpu=1, nh=256, niter=25, random_sample=False, saveInterval=500, trainroot='data/train_lmdb', valInterval=500, valroot='data/val_lmdb', workers=2)
Random Seed:  7014
Traceback (most recent call last):
  File "train.py", line 70, in <module>
    imgH=opt.imgH, imgW=opt.imgW, keep_ratio=opt.keep_ratio))
  File "/home/rezha/miniconda3/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 424, in __init__
    raise ValueError('sampler option is mutually exclusive with '
ValueError: sampler option is mutually exclusive with shuffle

I am using. Pytorch 0.4, running on GPU 1080 Ti at Ubuntu 16.04 LTS. I cloned from pytorch-0.4 branch of your crnn.pytorch repo.

What should i do?

meijieru commented 6 years ago

0.4 branch is not completed.

leonzhu211 commented 6 years ago

--random_sample

rezha130 commented 6 years ago

Hi @meijieru & @leonzhu211

Which pytorch version in master branch that you used?

leonzhu211 commented 6 years ago

maybe it's 0.3. For 0.4, you need modify some code lines, such as:

preds = preds.squeeze(2)

alexge233 commented 5 years ago

I can confirm this using pytorch 0.4.0. Is this expected behaviour?