hamelsmu / code_search

Code For Medium Article: "How To Create Natural Language Semantic Search for Arbitrary Objects With Deep Learning"

Home Page:https://medium.com/@hamelhusain/semantic-code-search-3cd6d244a39c

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

issue in fit method in fastai

gauravkoradiya opened this issue · comments

when i run a fit function in language model it shows a below error :

Epoch:   0%|          | 0/7 [00:00<?, ?it/s]
  0%|          | 0/3280 [00:00<?, ?it/s]
Traceback (most recent call last):
  File "E:/Mindtree_IDP/neural_language_model.py", line 41, in <module>
    wd=1e-6)
  File "E:\Mindtree_IDP\lang_model_utils.py", line 243, in train_lang_model
    best_save_name = 'language_model'
  File "C:\Users\GK\AppData\Roaming\Python\Python36\site-packages\fastai-0.7.0-py3.6.egg\fastai\learner.py", line 287, in fit
    return self.fit_gen(self.model, self.data, layer_opt, n_cycle, **kwargs)
  File "C:\Users\GK\AppData\Roaming\Python\Python36\site-packages\fastai-0.7.0-py3.6.egg\fastai\learner.py", line 234, in fit_gen
    swa_eval_freq=swa_eval_freq, **kwargs)
  File "C:\Users\GK\AppData\Roaming\Python\Python36\site-packages\fastai-0.7.0-py3.6.egg\fastai\model.py", line 132, in fit
    loss = model_stepper.step(V(x),V(y), epoch)
  File "C:\Users\GK\AppData\Roaming\Python\Python36\site-packages\fastai-0.7.0-py3.6.egg\fastai\model.py", line 50, in step
    output = self.m(*xs)
  File "c:\users\gk\appdata\local\continuum\anaconda3\envs\mindtree\lib\site-packages\torch\nn\modules\module.py", line 489, in __call__
    result = self.forward(*input, **kwargs)
  File "c:\users\gk\appdata\local\continuum\anaconda3\envs\mindtree\lib\site-packages\torch\nn\modules\container.py", line 92, in forward
    input = module(input)
  File "c:\users\gk\appdata\local\continuum\anaconda3\envs\mindtree\lib\site-packages\torch\nn\modules\module.py", line 489, in __call__
    result = self.forward(*input, **kwargs)
  File "C:\Users\GK\AppData\Roaming\Python\Python36\site-packages\fastai-0.7.0-py3.6.egg\fastai\lm_rnn.py", line 97, in forward
    raw_output, new_h = rnn(raw_output, self.hidden[l])
  File "c:\users\gk\appdata\local\continuum\anaconda3\envs\mindtree\lib\site-packages\torch\nn\modules\module.py", line 489, in __call__
    result = self.forward(*input, **kwargs)
  File "C:\Users\GK\AppData\Roaming\Python\Python36\site-packages\fastai-0.7.0-py3.6.egg\fastai\rnn_reg.py", line 122, in forward
    return self.module.forward(*args)
  File "c:\users\gk\appdata\local\continuum\anaconda3\envs\mindtree\lib\site-packages\torch\nn\modules\rnn.py", line 179, in forward
    self.dropout, self.training, self.bidirectional, self.batch_first)
RuntimeError: shape '[1000000, 1]' is invalid for input of size 2000

are you using the docker container?