Comments (3)
If you have e.g., 3 task A, B, C during the training, the task id for A, B, C is 0, 1, 2 respectively which is used to select the correct task header.
from mt-dnn.
I use this command:
python3 predict.py --task homicide --task_def dataset/all_task_def.yml --max_seq_len 128 --batch_size_eval 8 --checkpoint checkpoint/model_2.pt --prep_input dataset/bert-base-multilingual-cased/test.json --with_label --task_id 1 --score dataset/bert-base-multilingual-cased/test_pred.json
and here is an error:
Traceback (most recent call last):
File "predict.py", line 108, in <module>
with_label=args.with_label,
File "/home/thang/mt-dnn/mt_dnn/inference.py", line 97, in eval_model
score, pred, gold = model.predict(batch_info, batch_data)
File "/home/thang/mt-dnn/mt_dnn/model.py", line 421, in predict
score = self.mnetwork(*inputs)
File "/home/thang/.env/lib/python3.6/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
return forward_call(*input, **kwargs)
File "/home/thang/.env/lib/python3.6/site-packages/torch/nn/parallel/data_parallel.py", line 166, in forward
return self.module(*inputs[0], **kwargs[0])
File "/home/thang/.env/lib/python3.6/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
return forward_call(*input, **kwargs)
File "/home/thang/mt-dnn/mt_dnn/matcher.py", line 204, in forward
decoder_opt = self.decoder_opt[task_id]
IndexError: list index out of range
Hope you can help to figure out how to fix.
from mt-dnn.
In the predict.py, I have to modify this:
task_def_list = [task_def]*5 # 5 is the number of tasks, here all 5 tasks are binary classification
or define your one here, or by arguments if you want.
task_def_list = [task_def, task_def, task_def, task_def, task_def]
It seems predict.py
needed to rewrite a bit more to support multi head predictions.
from mt-dnn.
Related Issues (20)
- predict.py size mismatch for scoring_list.0.weight and scoring_list.0.bias error HOT 1
- Performance using ELECTRA and ROBERTA is significantly different from BERT HOT 3
- RuntimeError with SMART HOT 4
- Problem in SMART embedding HOT 1
- Unable to get the complete model MT_DNN
- Output data in different tasks at the same time
- Project dependencies may have API risk issues
- question about task split and pretrain model
- mt-dnn on Windows?
- Readme.md is updated?
- Can you provide the pretrain files of Hugging Face?
- Older version of Pytorch unavailable HOT 1
- Code for "Targeted Adversarial Training for Natural Language Understanding"
- where is run_mt_dnn.sh HOT 1
- Problems with downloading datasets and weights HOT 3
- ddp error in fintune the task-specific like rte
- Pretrained weights for transfer learning STS benmark
- ERROR 409: Public access is not permitted on this storage account HOT 3
- Public access is not permitted
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mt-dnn.