DrQA
DrQA copied to clipboard
AssertionError: Torch not compiled with CUDA enabled
$ python3 train.py -e 40 -bs 32
02/15/2020 05:17:11 [Program starts. Loading data...] 02/15/2020 05:22:48 {'log_per_updates': 3, 'data_file': 'SQuAD/data.msgpack', 'model_dir': '/Users/balagopalbhallamudi/Desktop/DrQA/models', 'save_last_only': False, 'save_dawn_logs': False, 'seed': 1013, 'cuda': False, 'epochs': 40, 'batch_size': 32, 'resume': '', 'resume_options': False, 'reduce_lr': 0.0, 'optimizer': 'adamax', 'grad_clipping': 10, 'weight_decay': 0, 'learning_rate': 0.1, 'momentum': 0, 'tune_partial': 1000, 'fix_embeddings': False, 'rnn_padding': False, 'question_merge': 'self_attn', 'doc_layers': 3, 'question_layers': 3, 'hidden_size': 128, 'num_features': 4, 'pos': True, 'ner': True, 'use_qemb': True, 'concat_rnn_layers': True, 'dropout_emb': 0.4, 'dropout_rnn': 0.4, 'dropout_rnn_output': True, 'max_len': 15, 'rnn_type': 'lstm', 'pretrained_words': True, 'vocab_size': 91590, 'embedding_dim': 300, 'pos_size': 50, 'ner_size': 19} 02/15/2020 05:22:48 [Data loaded.] 02/15/2020 05:22:48 Epoch 1 02/15/2020 07:07:48 > epoch [ 1] updates[ 2707] train loss[4.38260] remaining[0:00:00]
02/15/2020 07:09:46 dev EM: 53.140964995269634 F1: 64.78947947738538
Traceback (most recent call last):
File "train.py", line 377, in
I haven't fully tested the code in pure-CPU training. It seems like you'll have to remove the line 'torch_cuda_state': torch.cuda.get_rng_state()
for CPU-only training.
I can confirm that @hitvoice solution worked. In model.py, in save function, remove 'torch_cuda_state': torch.cuda.get_rng_state() and it will work. Model is getting saved without cuda