naver / sqlova

Apache License 2.0
632 stars 168 forks source link

RuntimeError: Buy new RAM!0 #21

Closed ArashEsk95 closed 5 years ago

ArashEsk95 commented 5 years ago

Hi, I'm trying to Run train.py but I'm getting this error. Should I really buy new rams? Thanks

Traceback (most recent call last): File "train.py", line 604, in dset_name='train') File "train.py", line 240, in train num_out_layers_n=num_target_layers, num_out_layers_h=num_target_layers) File "C:\Users\Admin\Desktop\Projects\University\Software\Trainer+Evaluator\sqlova-master\sqlova\utils\utils_wikisql.py", line 820, in get_wemb_bert nlu_tt, t_to_tt_idx, tt_to_t_idx = get_bert_output(model_bert, tokenizer, nlu_t, hds, max_seq_length) File "C:\Users\Admin\Desktop\Projects\University\Software\Trainer+Evaluator\sqlova-master\sqlova\utils\utils_wikisql.py", line 754, in get_bert_output all_encoder_layer, pooled_output = model_bert(all_input_ids, all_segment_ids, all_input_mask) File "C:\Users\Admin\Miniconda3\lib\site-packages\torch\nn\modules\module.py", line 493, in call result = self.forward(*input, kwargs) File "C:\Users\Admin\Desktop\Projects\University\Software\Trainer+Evaluator\sqlova-master\bert\modeling.py", line 396, in forward all_encoder_layers = self.encoder(embedding_output, extended_attention_mask) File "C:\Users\Admin\Miniconda3\lib\site-packages\torch\nn\modules\module.py", line 493, in call result = self.forward(*input, *kwargs) File "C:\Users\Admin\Desktop\Projects\University\Software\Trainer+Evaluator\sqlova-master\bert\modeling.py", line 326, in forward hidden_states = layer_module(hidden_states, attention_mask) File "C:\Users\Admin\Miniconda3\lib\site-packages\torch\nn\modules\module.py", line 493, in call result = self.forward(input, kwargs) File "C:\Users\Admin\Desktop\Projects\University\Software\Trainer+Evaluator\sqlova-master\bert\modeling.py", line 311, in forward attention_output = self.attention(hidden_states, attention_mask) File "C:\Users\Admin\Miniconda3\lib\site-packages\torch\nn\modules\module.py", line 493, in call result = self.forward(*input, kwargs) File "C:\Users\Admin\Desktop\Projects\University\Software\Trainer+Evaluator\sqlova-master\bert\modeling.py", line 272, in forward self_output = self.self(input_tensor, attention_mask) File "C:\Users\Admin\Miniconda3\lib\site-packages\torch\nn\modules\module.py", line 493, in call result = self.forward(*input, *kwargs) File "C:\Users\Admin\Desktop\Projects\University\Software\Trainer+Evaluator\sqlova-master\bert\modeling.py", line 236, in forward attention_probs = self.dropout(attention_probs) File "C:\Users\Admin\Miniconda3\lib\site-packages\torch\nn\modules\module.py", line 493, in call result = self.forward(input, kwargs) File "C:\Users\Admin\Miniconda3\lib\site-packages\torch\nn\modules\dropout.py", line 58, in forward return F.dropout(input, self.p, self.training, self.inplace) File "C:\Users\Admin\Miniconda3\lib\site-packages\torch\nn\functional.py", line 830, in dropout else _VF.dropout(input, p, training)) RuntimeError: [enforce fail at ..\c10\core\CPUAllocator.cpp:62] data. DefaultCPUAllocator: not enough memory: you tried to allocate %dGB. Buy new RAM!0

jcjview commented 5 years ago

23

Zhang-O commented 5 years ago

I get this too. I have no money

Chiaquan commented 5 years ago

@Zhang-O Me too

Zhang-O commented 5 years ago

@linjiaquan I use pytorch to inference ,then this problem occurs. But when i use tensorflow , the memory is enough.

ArashEsk95 commented 5 years ago

I bought 21GB of RAM, it solved my problem. also reducing batch file may help.