naver/sqlova

new error when run train.py

Opened this issue · 3 comments

image
when i first time to run the train.py in Pycharm on win10,but it occurs.
Can u tell me why? and how to fix it?Thx

Hi @zhilonglu
Maybe related with this issue #2.

Could you try again after change num_workers=4 to num_workers=0 in the code below?

def get_loader_wikisql(data_train, data_dev, bS, shuffle_train=True, shuffle_dev=False):
train_loader = torch.utils.data.DataLoader(
batch_size=bS,
dataset=data_train,
shuffle=shuffle_train,
num_workers=4,
collate_fn=lambda x: x # now dictionary values are not merged!
)
dev_loader = torch.utils.data.DataLoader(
batch_size=bS,
dataset=data_dev,
shuffle=shuffle_dev,
num_workers=4,
collate_fn=lambda x: x # now dictionary values are not merged!
)
return train_loader, dev_loader

Thanks!

Wonseok

OK i'll try later, thanks
just moment ago i found this link
https://discuss.pytorch.org/t/cant-pickle-local-object-dataloader-init-locals-lambda/31857/9
maybe it solves my problem。
But another problem occurs,so dispirited!

you can fix this problem by converting the lambda function to a normal one, let's say identify
def identify(x): return x
then replace lambda x:x by identify.
if you get a new error try to set num_workers to 0 like @whwang299 has said.