GithubHelp home page GithubHelp logo

msft-vivi / smp2020---weibo-sentiment-classification Goto Github PK

View Code? Open in Web Editor NEW
68.0 3.0 21.0 6.09 MB

SMP 2020年微博情感分类评测任务 第六名解决方案

Python 93.97% Shell 6.03%
nlp smp

smp2020---weibo-sentiment-classification's Issues

Exception has occurred: TypeError

错误信息:

an integer is required (got type NoneType)
  File "/home/fsnip/SMP2020---Weibo-sentiment-classification/baseline/utils.py", line 85, in collate_batch
    batch[k] = torch.tensor([getattr(f, k) for f in features], dtype=torch.long)
  File "/home/fsnip/SMP2020---Weibo-sentiment-classification/baseline/train_and_eval.py", line 83, in trains
    for step, batch in enumerate(train_dataloader):
  File "/home/fsnip/SMP2020---Weibo-sentiment-classification/baseline/roberta_k_fold.py", line 335, in main
    trains(args, train_dataset, dev_dataset, model, str(fold_num))
  File "/home/fsnip/SMP2020---Weibo-sentiment-classification/baseline/roberta_k_fold.py", line 353, in <module>
    main()

我运行时的配置:

python roberta_k_fold.py \
	--pre_train_path roberta_large \
	--model_name BertBase \
	--output_dir usual_k_fold_model/roberta_large \
	--data_dir k_fold/usual \
	--max_seq_length 140 \
	--train_batch_size 8 \
	--gradient_accumulation_steps 8 \
	--num_train_epochs 20 \
	--learning_rate 1e-5 \
	--warmup_rate 0.3 \
	--weight_decay 0.02 \
	--attack fgm \
	--log_dir roberta_large.log \
	--k_fold 5 \
	--do_train

请问这个错误是什么原因造成的?

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.