fairseq icon indicating copy to clipboard operation
fairseq copied to clipboard

How to Run Model Training via Python File Directly Instead of Using CLI?

Open ardianumam opened this issue 2 years ago • 1 comments

Hi,

As written in the title, how can we run model training, e.g., wav2vec2.0, from the python file instead of via CLI? My use case is that I want to understand the data flow and training details, so, I prefer to debug the code (e.g., using step over, step into, etc of a typical debugging tool) to understand the details. Thanks much!

What's your environment?

  • fairseq Version (e.g., 1.0 or main): 10.2
  • PyTorch Version (e.g., 1.0): 1.9.0
  • OS (e.g., Linux): Linux
  • How you installed fairseq (pip, source): source
  • Build command you used (if compiling from source): pip install --editable ./
  • Python version:3.8.13
  • CUDA/cuDNN version: 11.1
  • GPU models and configuration: Tesla T4

ardianumam avatar Jun 24 '22 11:06 ardianumam

use python fairseq/fairseq_cli/train.py {following the same command line arguments you need} There are also preprocess.py, generate.py, interactive.py. When you finish reading through them, congratulations you have learnt the most fairseq.

gmryu avatar Jun 25 '22 00:06 gmryu