accelerate icon indicating copy to clipboard operation
accelerate copied to clipboard

[windows10 error] accelerate: command not found

Open xdobetter opened this issue 2 years ago • 4 comments

Previously I was able to execute the code commands successfully under linux, but when I switched to windows10, I already installed accelerate, but when I executed the code sample below dreambooth, I had the following issues when I executed the bash script in CMD.

error content below

(large-model) J:\Program\lib_diffusers\diffusers\examples\dreambooth>bash run-dog.bash
run-dog.bash: line 5: accelerate: command not found

bash script content below

export MODEL_NAME="runwayml/stable-diffusion-v1-5"
export INSTANCE_DIR="./data/dog"
export OUTPUT_DIR="model_fine-tune-dog"

accelerate launch train_dreambooth.py \
  --pretrained_model_name_or_path=$MODEL_NAME  \
  --instance_data_dir=$INSTANCE_DIR \
  --output_dir=$OUTPUT_DIR \
  --instance_prompt="a photo of sks dog" \
  --resolution=512 \
  --train_batch_size=1 \
  --gradient_accumulation_steps=1 \
  --learning_rate=5e-6 \
  --lr_scheduler="constant" \
  --lr_warmup_steps=0 \
  --max_train_steps=400 \
  --push_to_hub

If I run the following command from the command line, I get the following

(large-model) J:Program\lib_diffusers\diffusers\examples\dreambooth>accelerate
usage: accelerate <command> [<args>]

positional arguments:
  {config,estimate-memory,env,launch,tpu-config,test}
                        accelerate command helpers

optional arguments:
  -h, --help            show this help message and exit

Can anyone give me some advice on this problem?Thanks~

xdobetter avatar Feb 28 '24 14:02 xdobetter

In your bash script you need to activate the conda environment probably

muellerzr avatar Feb 28 '24 14:02 muellerzr

The above result has my conda environment running,so your advise like this:

export MODEL_NAME="runwayml/stable-diffusion-v1-5"
export INSTANCE_DIR="./data/dog"
export OUTPUT_DIR="model_fine-tune-dog"
conda activate large-model # add command
accelerate launch train_dreambooth.py \
  --pretrained_model_name_or_path=$MODEL_NAME  \
  --instance_data_dir=$INSTANCE_DIR \
  --output_dir=$OUTPUT_DIR \
  --instance_prompt="a photo of sks dog" \
  --resolution=512 \
  --train_batch_size=1 \
  --gradient_accumulation_steps=1 \
  --learning_rate=5e-6 \
  --lr_scheduler="constant" \
  --lr_warmup_steps=0 \
  --max_train_steps=400 \
  --push_to_hub

but it still dont't work. And it tells me that I have the following error

(large-model) J:\Program\lib_diffusers\diffusers\examples\dreambooth>bash run-dog.bash
run-dog.bash: line 4: conda command not found
run-dog.bash: line 5: accelerate: command not found

xdobetter avatar Feb 29 '24 13:02 xdobetter

Try source activate. This is the root of your problem that you will need to try and figure out. I don't have much experience with windows sadly to advise other than that :)

muellerzr avatar Feb 29 '24 13:02 muellerzr

Thank you for your answer, I will try to fix it:)

xdobetter avatar Mar 02 '24 12:03 xdobetter

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the contributing guidelines are likely to be ignored.

github-actions[bot] avatar Mar 29 '24 15:03 github-actions[bot]