Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Traanning Question #66

Open
DLWangSan opened this issue Dec 6, 2020 · 3 comments
Open

Traanning Question #66

DLWangSan opened this issue Dec 6, 2020 · 3 comments

Comments

@DLWangSan
Copy link

Hello, Thanks for your contribution!
When I was training my data use:

train.py --trainroot lmdb\data\train\data.mdb --valroot lmdb\data\val\data,mdb

the program reply me with:

Traceback (most recent call last):
  File "train.py", line 63, in <module>
    train_loader, val_loader = data_loader()
  File "train.py", line 46, in data_loader
    train_dataset = dataset.lmdbDataset(root=args.trainroot)
  File "C:\projectFiles\pythonProject\learnining\crnn-pytorch-master\dataset.py", line 20, in __init__
    self.env = lmdb.open(
lmdb.Error: lmdb\data\train\data.mdb: ϵͳ�Ҳ���ָ����·����

and if i use the following instruction:

python train.py --trainroot lmdb\data\train\ --valroot lmdb\data\val

the program reply me with nothing. So i add a line in train.pyfile:

print("Len:", len(train_loader))

then the program reply with

CRNN(
  (cnn): Sequential(
    (conv0): Conv2d(1, 64, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
    (relu0): ReLU(inplace=True)
    (pooling0): MaxPool2d(kernel_size=2, stride=2, padding=0, dilation=1, ceil_mode=False)
    (conv1): Conv2d(64, 128, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
    (relu1): ReLU(inplace=True)
    (pooling1): MaxPool2d(kernel_size=2, stride=2, padding=0, dilation=1, ceil_mode=False)
    (conv2): Conv2d(128, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
    (batchnorm2): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
    (relu2): ReLU(inplace=True)
    (conv3): Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
    (relu3): ReLU(inplace=True)
    (pooling2): MaxPool2d(kernel_size=(2, 2), stride=(2, 1), padding=(0, 1), dilation=1, ceil_mode=False)
    (conv4): Conv2d(256, 512, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
    (batchnorm4): BatchNorm2d(512, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
    (relu4): ReLU(inplace=True)
    (conv5): Conv2d(512, 512, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
    (relu5): ReLU(inplace=True)
    (pooling3): MaxPool2d(kernel_size=(2, 2), stride=(2, 1), padding=(0, 1), dilation=1, ceil_mode=False)
    (conv6): Conv2d(512, 512, kernel_size=(2, 2), stride=(1, 1))
    (batchnorm6): BatchNorm2d(512, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
    (relu6): ReLU(inplace=True)
  )
  (rnn): Sequential(
    (0): BidirectionalLSTM(
      (rnn): LSTM(512, 256, bidirectional=True)
      (embedding): Linear(in_features=512, out_features=256, bias=True)
    )
    (1): BidirectionalLSTM(
      (rnn): LSTM(256, 256, bidirectional=True)
      (embedding): Linear(in_features=512, out_features=131, bias=True)
    )
  )
)
Len: 1
Len: 1
Len: 1
Len: 1
Len: 1
Len: 1
Len: 1
Len: 1
Len: 1
Len: 1
Len: 1
Len: 1
Len: 1
Len: 1
Len: 1
Len: 1

I don't know why my Len is 1,and I do not know how to do.
Thanks!

@Zrufy
Copy link

Zrufy commented Jan 8, 2021

@Holmeyoung

@Zrufy
Copy link

Zrufy commented Jan 8, 2021

how many images have in your dataset i think depend from param you use but @Holmeyoung is more prepared than me.

@BinhPQ2
Copy link

BinhPQ2 commented Sep 20, 2022

I also have this problem and I don't know why, I have 500 images as training images but the len(train_loader) is only 8. Why is that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants