Using torch (1.1.0)
, flair (0.4.2)
[1], I get the following error when I try to train a model.
File "/home/foobar/github/cbd/venv/lib/python3.6/site-packages/torch/nn/modules/rnn.py", line 204, in forward
_impl = _rnn_impls[self.mode]
KeyError: 'GRU'
Python interpeter
>>> import torch
>>> torch.version.cuda
'10.0.130'
>>> torch.cuda.is_available()
True
My understanding is a bit shaky. Should the version of nvcc compilation tools
align with torch
's cuda version? It doesn’t, but as you can see above, cuda is still available.
If there’s anything I’ve missed that might help diagnosing, please say.
Shell
$ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2017 NVIDIA Corporation
Built on Fri_Nov__3_21:07:56_CDT_2017
Cuda compilation tools, release 9.1, V9.1.85
[1] Flair NLP – https://github.com/zalandoresearch/flair
Full error
2019-08-12 17:49:33,828 Reading data from /home/foobar/tmp/splits
2019-08-12 17:49:33,828 Train: /home/foobar/tmp/splits/train.txt
2019-08-12 17:49:33,828 Dev: /home/foobar/tmp/splits/dev.txt
2019-08-12 17:49:33,828 Test: /home/foobar/tmp/splits/test.txt
2019-08-12 17:59:10,064 {'noncb', 'cb'}
2019-08-12 18:08:17,296 ----------------------------------------------------------------------------------------------------
2019-08-12 18:08:17,296 Evaluation method: MICRO_F1_SCORE
Traceback (most recent call last):
File "/home/foobar/github/cbd/venv/bin/cbd-train", line 11, in <module>
load_entry_point('cbd', 'console_scripts', 'cbd-train')()
File "/home/foobar/github/cbd/cb/train.py", line 50, in train
max_epochs=150)
File "/home/foobar/github/cbd/venv/lib/python3.6/site-packages/flair/trainers/trainer.py", line 93, in train
embeddings_in_memory,
File "/home/foobar/github/cbd/venv/lib/python3.6/site-packages/flair/models/text_classification_model.py", line 177, in evaluate
labels, loss = self.forward_labels_and_loss(batch)
File "/home/foobar/github/cbd/venv/lib/python3.6/site-packages/flair/models/text_classification_model.py", line 108, in forward_labels_and_loss
scores = self.forward(sentences)
File "/home/foobar/github/cbd/venv/lib/python3.6/site-packages/flair/models/text_classification_model.py", line 70, in forward
self.document_embeddings.embed(sentences)
File "/home/foobar/github/cbd/venv/lib/python3.6/site-packages/flair/embeddings.py", line 2081, in embed
rnn_out, hidden = self.rnn(packed)
File "/home/foobar/github/cbd/venv/lib/python3.6/site-packages/torch/nn/modules/module.py", line 547, in __call__
result = self.forward(*input, **kwargs)
File "/home/foobar/github/cbd/venv/lib/python3.6/site-packages/torch/nn/modules/rnn.py", line 204, in forward
_impl = _rnn_impls[self.mode]
KeyError: 'GRU'