-
Install MMF following the installation docs.
-
Convert data into MMF format. Following the prerequisites part of Hateful Memes Dataset.
There will be a path that shows where is data of .jsonl and images. Copy it! It will be used in step 4. -
Install requirement.txt
pip install -r requirements.txt
-
Download the pre-trained models.
Address: https://pan.baidu.com/s/1KzRPwRo9BQORBdYLhoed_A Password: 1122 -
Modify path
In triad_tuples.py, change annotations_fold and images_fold to the path of data of .jsonl and images.
In predict_training.sh, change annotations_fold to the path of data of .jsonl.
The path is copied in step 2.
- Modify predict_models.sh
In predict_models.sh, change predict_cuda_num to index of cuda that you want to predict. - Grant run permission
chmod a+x predict_models.sh
or
sudo chmod a+x predict_models.sh
- Run predict_models.sh
./predict_models.sh
- Modify predict_training.sh
In predict_training.sh, change training_cuda_num and predict_cuda_num to index of cuda that you want to train and predict. - Grant run permission
chmod a+x predict_training.sh
or
sudo chmod a+x predict_training.sh
- Run predict_training.sh
./predict_training.sh
final_result.csv in the current directory is the final submission.
If it is interrupted when run predict_training.sh, change train.jsonl.bak and dev_unseen.json.bak to train.jsonl and dev_unseen.jsonl before run it again or run any other MMF models.
Because I use KFold technique, train.jsonl and dev_unseen.jsonl are changed during runing.