crnn.pytorch icon indicating copy to clipboard operation
crnn.pytorch copied to clipboard

ValueError: sampler option is mutually exclusive with shuffle

Open rezha130 opened this issue 6 years ago • 5 comments

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?

rezha130 avatar Jun 22 '18 08:06 rezha130

0.4 branch is not completed.

meijieru avatar Jun 22 '18 10:06 meijieru

--random_sample

leonzhu211 avatar Jun 28 '18 06:06 leonzhu211

Hi @meijieru & @leonzhu211

Which pytorch version in master branch that you used?

rezha130 avatar Jul 04 '18 06:07 rezha130

maybe it's 0.3. For 0.4, you need modify some code lines, such as: #preds = preds.squeeze(2)

leonzhu211 avatar Jul 04 '18 07:07 leonzhu211

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

alexge233 avatar Oct 06 '18 11:10 alexge233