Coder Social home page Coder Social logo

Comments (11)

lucashu1234 avatar lucashu1234 commented on May 29, 2024 2

还补充个问题,89行 batch_output_all = np.append(batch_output_all, batch_output, axis=0)
这个方法在numpy最新的numpy版本上会出现拼接数组的时候个数不对齐的问题,这里不能用最新的numpy版本

from pytorch_bert_bilstm_crf_ner.

taishan1994 avatar taishan1994 commented on May 29, 2024 1

main.py的109行test方法中 测试的时候传的数据用的是dev_loader,为什么不是test_loader,test_loader数据好像一直都没用到

现在改了下,如果有test_loader就使用test_loader,否则传参时设置test_loader为dev_loader即可。

from pytorch_bert_bilstm_crf_ner.

taishan1994 avatar taishan1994 commented on May 29, 2024 1

test方法还是有点问题,该方法数据用的test_loader,113行验证的标签用的测试集的标签dev_callback_info

这个修改了下。

from pytorch_bert_bilstm_crf_ner.

taishan1994 avatar taishan1994 commented on May 29, 2024 1

89行numpy不兼容的原因找到了, batch_output_all = np.append(batch_output_all, batch_output, axis=0) batch_output本来是个二维数组,当某个batch中batch_output只有一条数据时,会把自动当成一维数组处理,造成维度不一致的报错

这个也改了下。

from pytorch_bert_bilstm_crf_ner.

taishan1994 avatar taishan1994 commented on May 29, 2024

请教一下为什么main.py中测试结果用的是训练集

具体是哪个地方呢?

from pytorch_bert_bilstm_crf_ner.

lucashu1234 avatar lucashu1234 commented on May 29, 2024

main.py的109行test方法中 测试的时候传的数据用的是dev_loader,为什么不是test_loader,test_loader数据好像一直都没用到

from pytorch_bert_bilstm_crf_ner.

taishan1994 avatar taishan1994 commented on May 29, 2024

main.py的109行test方法中 测试的时候传的数据用的是dev_loader,为什么不是test_loader,test_loader数据好像一直都没用到

因为有的数据只有dev数据,没有test数据,这里统一都设置成了dev,你可以根据实际情况进行修改。

from pytorch_bert_bilstm_crf_ner.

lucashu1234 avatar lucashu1234 commented on May 29, 2024

test方法还是有点问题,该方法数据用的test_loader,113行验证的标签用的测试集的标签dev_callback_info

from pytorch_bert_bilstm_crf_ner.

lucashu1234 avatar lucashu1234 commented on May 29, 2024

89行numpy不兼容的原因找到了, batch_output_all = np.append(batch_output_all, batch_output, axis=0)
batch_output本来是个二维数组,当某个batch中batch_output只有一条数据时,会把自动当成一维数组处理,造成维度不一致的报错

from pytorch_bert_bilstm_crf_ner.

VICKY-ZZ avatar VICKY-ZZ commented on May 29, 2024

签dev_callback_info
使得!我也发现了这个问题,请问最终解决了吗

from pytorch_bert_bilstm_crf_ner.

VICKY-ZZ avatar VICKY-ZZ commented on May 29, 2024

89行numpy不兼容的原因找到了, batch_output_all = np.append(batch_output_all, batch_output, axis=0) batch_output本来是个二维数组,当某个batch中batch_output只有一条数据时,会把自动当成一维数组处理,造成维度不一致的报错

这个也改了下。

请问最终是如何解决的呐?感谢!

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.