背景
使用 accelerate 進行分布式代碼訓練時,需要在pycharm中進行調試,此時需要在pycharm中運行。
終端執行命令
# *[Specify the config file path and the GPU devices to use]
export CUDA_VISIBLE_DEVICES=0# *[Specify the config file path]
export OMINI_CONFIG=./train/config/subject_dj.yamlecho $OMINI_CONFIG
export TOKENIZERS_PARALLELISM=true# 這里是使用單卡進行訓練
accelerate launch --num_processes=1 --num_machines=1 --machine_rank=0 --main_process_port 41353 -m omini.train_flux.train_subject_dj
Pycharm設置
參考
1,?accelerate在pycham中執行的方法_pycharm accelerate-CSDN博客
2,?accelerate在pycham中執行的方法_pycharm accelerate-CSDN博客
3,?https://github.com/huggingface/accelerate/issues/535