masashi-y / depccg

A* CCG Parser with a Supertag and Dependency Factored Model
MIT License
93 stars 28 forks source link

Fix LSTM call #23

Closed ianyfan closed 3 years ago

ianyfan commented 3 years ago

Otherwise I get the error:

  ...
  File ".../depccg/depccg/__main__.py", line 166, in <module>
    parse_args(main)
  File ".../depccg/depccg/argparse.py", line 203, in parse_args
    args.func(args)
  File ".../depccg/depccg/__main__.py", line 126, in main
    score_result, categories_ = supertagger.predict_doc(
  File ".../depccg/depccg/chainer/lstm_parser_bi_fast.py", line 203, in predict_doc
    pred = self._predict(batch)
  File ".../depccg/depccg/chainer/lstm_parser_bi_fast.py", line 189, in _predict
    cat_ys, dep_ys = self.forward(ws, ss, ps, ls)
  File ".../depccg/depccg/chainer/lstm_parser_bi_fast.py", line 151, in forward
    _, _, hs_f = self.lstm_f(hx_f, cx_f, xs_f, train=False)
  File ".../depccg/depccg/chainer/fixed_length_n_step_lstm.py", line 138, in __call__
    hy, cy, ys = fixed_length_n_step_lstm(
  File ".../depccg/depccg/chainer/fixed_length_n_step_lstm.py", line 419, in fixed_length_n_step_lstm
    c_bar, h_bar = lstm.lstm(c, lstm_in)
AttributeError: 'function' object has no attribute 'lstm'
masashi-y commented 3 years ago

Thank you for the pull request. I confirmed the issue. Sorry to take the action late!