Configuring launch.json in vscode

"configurations": [
        {
            "name": "Python: my tod training",
            "type": "python",
            "request": "launch",
            "program": "${file}",
            "console": "integratedTerminal",
            "args": [
                "--task=usdl",
                "--model_type=bert",
                "--model_name_or_path=bert-base-uncased",
                "--output_dir=",
                "--do_train",
                "--do_eval",
                "--mlm",
                "--do_lower_case",
                "--evaluate_during_training",
                "--save_steps=2500",
                "--logging_steps=1000",
                "--per_gpu_train_batch_size=1",
                "--per_gpu_eval_batch_size=1",
                "--only_last_turn"
            ]
        }
    ]

Running Debug Session

open my_tod_pretraining.py and press F5 to start a debug session using the configuration shown above.

bug report: initial bug report

initial bug console report

Debugging

adding breakpoint on line 458 of my_tod_pretraining.py, and use F11:Step into to dig into the situation.

It says that forward() function meets an unexpected argument relating to variable ‘label’. Comparing values of ‘label’ in different env: CPU CUDA

Following an answer on stackoverflow, change the argument name from “masked_lm_labels” to “labels”. It solved the TypeError problem. But the training process would be killed unexpectedly without warning or any log information.