Coder Social home page Coder Social logo

Comments (1)

taishan1994 avatar taishan1994 commented on June 4, 2024

使用数据集cner训练bert-bilstm和bert-bilstm-crf模型后,运行predict.py出现以下报错

raceback (most recent call last): File "F:/NER_project/pytorch_bert_bilstm_crf_ner/predict.py", line 120, in print(batch_predict(raw_text, model, device, args, id2query)) File "F:/NER_project/pytorch_bert_bilstm_crf_ner/predict.py", line 39, in batch_predict logits = model(token_ids, attention_masks, token_type_ids, None) File "D:\Envs\easy_bert\lib\site-packages\torch\nn\modules\module.py", line 889, in _call_impl result = self.forward(*input, **kwargs) File "F:\NER_project\pytorch_bert_bilstm_crf_ner\bert_ner_model.py", line 269, in forward seq_out = seq_out.contiguous().view(batch_size, self.args.max_seq_len, -1) # [batchsize, max_len, num_tags] RuntimeError: shape '[1, 150, -1]' is invalid for input of size 1815

看一下你的参数。

from pytorch_bert_bilstm_crf_ner.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.