huggingface / huggingface/diffusers
ConnectionError: Tried to launch distributed communication on port 29401, but another process is utilizing it. Please specify a different port (such as using the --main_process_port flag or specifying a different main_process_port in your config file) and rerun your script. To automatically use the next open port (on a single node), you can set this to 0.
- Lingua principale
- Python
- Stelle
- 34.5k
- Fork
- 7.3k
- Merge medio
- 3g 3h
- PR unite (30g)
- 91
Descrizione
### Describe the bug
ConnectionError: Tried to launch distributed communication on port 29401, but another process is utilizing it. Please specify a different port (such as using the --main_process_port flag or specifying a different main_process_port in your config file) and rerun your script. To automatically use the next open port (on a single node), you can set this to 0.
### Reproduction
export MODEL_NAME="CompVis/stable-diffusion-v1-4" \
export TRAIN_DATA_DIR="/home/qinchang/pro/qc/new_project/newConcept/data/poisoned_images" \
export OUTPUT_DIR="/home/qinchang/pro/qc/new_project/newConcept/model/model_first" \
CUDA_VISIBLE_DEVICES=1 accelerate launch --config_file="/home/qinchang/.cache/huggingface/accelerate/default_config.yaml" train_text_to_image_lora.py \
--pretrained_model_name_or_path=$MODEL_NAME \
--train_data_dir=$TRAIN_DATA_DIR --caption_column="additional_feature" \
--resolution=512 --random_flip \
--train_batch_size=1 \
--num_train_epochs=100 --checkpointing_steps=5000 \
--learning_rate=1e-04 --lr_scheduler="constant" --lr_warmup_steps=0 \
--seed=42 \
--output_dir=$OUTPUT_DIR \
--validation_prompt=None --report_to="wandb"
### Logs
```shell
Traceback (most recent call last):
File "/home/qinchang/miniconda3/envs/diagnosis_new/bin/accelerate", line 8, in
sys.exit(main())
File "/home/qinchang/miniconda3/envs/diagnosis_new/lib/python3.9/site-packages/accelerate/commands/accelerate_cli.py", line 48, in main
args.func(args)
File "/home/qinchang/miniconda3/envs/diagnosis_new/lib/python3.9/site-packages/accelerate/commands/launch.py", line 1159, in launch_command
multi_gpu_launcher(args)
File "/home/qinchang/miniconda3/envs/diagnosis_new/lib/python3.9/site-packages/accelerate/commands/launch.py", line 771, in multi_gpu_launcher
current_env = prepare_multi_gpu_env(args)
File "/home/qinchang/miniconda3/envs/diagnosis_new/lib/python3.9/site-packages/accelerate/utils/launch.py", line 212, in prepare_multi_gpu_env
raise ConnectionError(
ConnectionError: Tried to launch distributed communication on port `29400`, but another process is utilizing it. Please specify a different port (such as using the `--main_process_port` flag or specifying a different `main_process_port` in your config file) and rerun your script. To automatically use the next open port (on a single node), you can set this to `0`.
```
### System Info
Diffusers version: 0.31.0
- Platform: Linux-6.8.0-48-generic-x86_64-with-glibc2.39
- Running on Google Colab?: No
- Python version: 3.9.18
- PyTorch version (GPU?): 2.5.1+cu124 (True)
- Flax version (CPU?/GPU?/TPU?): not installed (NA)
- Jax version: not installed
- JaxLib version: not installed
- Huggingface_hub version: 0.26.2
- Transformers version: 4.46.1
- Accelerate version: 1.1.0
- PEFT version: not installed
- Bitsandbytes version: not installed
- Safetensors version: 0.4.5
- xFormers version: not installed
- Accelerator: NVIDIA GeForce RTX 3090 Ti, 24564 MiB
NVIDIA GeForce RTX 3090 Ti, 24564 MiB
- Using GPU in script?: yes
- Using distributed or parallel set-up in script?: yes
one machine with two gpus
### Who can help?
_No response_
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Start with the reported `accelerate launch` command, `train_text_to_image_lora.py`, and the referenced `default_config.yaml`, focusing on `main_process_port` and the distributed launch path. Reproduce the port-in-use case and determine whether the expected outcome is a code change or clearer documentation; done should include a verified resolution for the reported launch failure.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- python, pytorch
- Ambito
- distributed-systems, machine-learning
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Da chiarire
- Idoneità per principianti
- 20/100