Follow the steps below to set up the environment and dependencies for the project:
- Create a Conda Environment
Create a new Conda environment named mmslt with Python version 3.8.0:
conda create -n mmslt python=3.8.0
- Activate the Conda Environment
Activate the newly created environment:
conda activate mmslt
- Install Dependencies
Install the required dependencies using requirements.txt:
pip install -r requirements.txt
To train the MMLP (MultiModal Language Processing) model, run the following command:
CUDA_VISIBLE_DEVICES=0,1,2,3 python -m torch.distributed.launch \
--nproc_per_node=4 \
--master_port=1234 \
--use_env train_mmlp.py \
--batch-size 4 \
--epochs 80 \
--opt adamw \
--lr 1e-4 \
--output_dir /path/to/your/path/pretrain_models/mmlp
- Replace
/path/to/your/path/pretrain_models/mmlpwith the directory path where you want to save the MMLP model checkpoints and outputs.
To fine-tune the MMSLT (MultiModal Spoken Language Translation) model, run the following command:
CUDA_VISIBLE_DEVICES=0,1,2,3 python -m torch.distributed.launch \
--nproc_per_node=4 \
--master_port=1234 \
--use_env train_mmslt.py \
--batch-size 2 \
--epochs 200 \
--opt adamw \
--lr 1e-4 \
--finetune /path/to/your/path/pretrain_models/mmlp/best_checkpoint.pth \
--output_dir /path/to/your/path/out/mmslt
-
Replace
/path/to/your/path/pretrain_models/mmlp/best_checkpoint.pthwith the path to the best checkpoint from the MMLP training process. -
Replace
/path/to/your/path/out/mmsltwith the directory path where you want to save the MMSLT model checkpoints and outputs.
- The
--nproc_per_node=4flag specifies that the training will use 4 GPUs. Adjust this based on your available GPU resources. However, for exact reproducibility of the results, it is highly recommended to use 4 GPUs as specified. - Text sign descriptions and weight files in our GoogleDrive