Git Product home page Git Product logo

bert_chinese_pytorch's Issues

请教.json文件的具体张什么样啊

.json的文件怎么生成的啊。。。我现在有每行的格式是:label\t文本的.txt文件,不知道怎么变成代码里可以用的json文件。。。
求教

example转feature

我使用example转feature的时候加载时间很长,经常卡在那里不动,请问你有遇到过吗

您好,请问‘’Weights of BertForSequenceClassification not initialized from pretrained model: ['classifier.weight', 'classifier.bias']‘’这种情况您碰到过吗,这样权重无法加载,预训练模型的意义也发挥不出来。

您好,请问‘’Weights of BertForSequenceClassification not initialized from pretrained model: ['classifier.weight', 'classifier.bias']‘’这种情况您碰到过吗,这样权重无法加载,预训练模型的意义也发挥不出来。

> 不过现在好像在

不过现在好像在

model = BertForSequenceClassification.from_pretrained(args.bert_model,
                                                          cache_dir=PYTORCH_PRETRAINED_BERT_CACHE / 'distributed_{}'.format(
                                                              args.local_rank))

这一行会报如下的错误:

File "/root/anaconda3/envs/liu37/lib/python3.7/site-packages/pytorch_pretrained_bert/modeling.py", line 581, in from_pretrained
   model = cls(config, *inputs, **kwargs)
TypeError: __init__() missing 1 required positional argument: 'num_labels'

我也是这个问题,请问你解决了吗?

Originally posted by @Zhaohaoran1997 in #1 (comment)

EOFError: Compressed file ended before the end-of-stream marker was reached

抱歉打扰您。我在运行过程中又遇到了模型出错问题。
这个问题我在pytor_pretrained_bert的issue里看到过,但作者说2018年11月就已经解决了这个问题,我看我现在运行的代码中也包含了修正后的部分。不知道我这现在是什么情况?

报错__init__() missing 1 required positional argument: 'num_labels'

Traceback (most recent call last):
File "bert.py", line 651, in
main()
File "bert.py", line 541, in main
cache_dir=PYTORCH_PRETRAINED_BERT_CACHE / 'distributed_{}'.format(args.local_rank))
File "/home/lindseywang/.local/lib/python3.6/site-packages/pytorch_pretrained_bert/modeling.py", line 581, in from_pretrained
model = cls(config, *inputs, **kwargs)
TypeError: init() missing 1 required positional argument: 'num_labels'

请问这是因为什么呢?

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.