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

Run Time Error and Transfer Learning? #6

Open
ks0m1c opened this issue Mar 18, 2019 · 0 comments
Open

Run Time Error and Transfer Learning? #6

ks0m1c opened this issue Mar 18, 2019 · 0 comments

Comments

@ks0m1c
Copy link

ks0m1c commented Mar 18, 2019

I got the following error while compiling
python train.py -src_data data/europarl-v7_de.txt -trg_data data/europarl-v7_en.txt -src_lang de -trg_lang en -SGDR -epochs 10 -checkpoint 10 -batchsize 128 -load_weights weights
loading spacy tokenizers...
loading presaved fields...
creating dataset and iterator...
The device argument should be set by using torch.device or passing a string as an argument. This behavior will be deprecated soon and currently defaults to cpu.
Traceback (most recent call last):
File "train.py", line 185, in
main()
File "train.py", line 97, in main
opt.train = create_dataset(opt, SRC, TRG)
File "Documents\transformers\Process.py", line 89, in create_dataset
opt.train_len = get_len(train_iter)
File "Documents\transformers\Process.py", line 95, in get_len
for i, b in enumerate(train):
File "envs\alexandria\lib\site-packages\torchtext\data\iterator.py", line 157, in iter
yield Batch(minibatch, self.dataset, self.device)
File "Anaconda3\envs\alexandria\lib\site-packages\torchtext\data\batch.py", line 34, in init
setattr(self, name, field.process(batch, device=device))
File "Anaconda3\envs\alexandria\lib\site-packages\torchtext\data\field.py", line 201, in process
tensor = self.numericalize(padded, device=device)
File "Anaconda3\envs\alexandria\lib\site-packages\torchtext\data\field.py", line 323, in numericalize
var = torch.tensor(arr, dtype=self.dtype, device=device)
RuntimeError: sizes must be non-negative
I am not sure why this is occurring but I had changed my source and training parallel corpus to a larger europarl dataset is such transfer learning supported? If not how would i go about doing that.
EDIT 1: I have subsequently trained it a model from scratch with a batchsize of 128 ( I am running on a GTX960M) and encounter the same problem.

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

1 participant