# SageMakerConfig object has no attribute gpu\_ids

**URL:** <https://discuss.huggingface.co/t/sagemakerconfig-object-has-no-attribute-gpu-ids/24174>\
**Category:** 🤗Accelerate\
**Created:** [October 9, 2022, 7:38am UTC](https://discuss.huggingface.co/t/sagemakerconfig-object-has-no-attribute-gpu-ids/24174 "2022-10-09T07:38:51Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jadechip](https://avatars.discourse-cdn.com/v4/letter/j/82dd89/32.png) [@jadechip](https://discuss.huggingface.co/u/jadechip)\
**Post date:** [October 9, 2022, 7:38am UTC](https://discuss.huggingface.co/t/sagemakerconfig-object-has-no-attribute-gpu-ids/24174/1 "2022-10-09T07:38:51Z")

</div>

Hello everyone,

I am trying to run the Dreambooth training example from the diffusers repo, **on Sagemaker** : [diffusers/examples/dreambooth at main · huggingface/diffusers · GitHub](https://github.com/huggingface/diffusers/tree/main/examples/dreambooth)

However I am getting the following error:

`AttributeError: 'SageMakerConfig' object has no attribute 'gpu_ids'`.

Here are the flags I am using:

```auto
export MODEL_NAME="CompVis/stable-diffusion-v1-4"
export INSTANCE_DIR="s3://instance-images"
export OUTPUT_DIR="/opt/ml/model"

accelerate launch train_dreambooth.py \
  --aws_access_key_id="XXXXXXXXXX" \
  --aws_secret_access_key="XXXXXXXX" \
  --pretrained_model_name_or_path=$MODEL_NAME \
  --instance_data_dir=$INSTANCE_DIR \
  --output_dir=$OUTPUT_DIR \
  --with_prior_preservation --prior_loss_weight=1.0 \
  --instance_prompt="a photo of sks cat" \
  --class_prompt="a photo of cat" \
  --resolution=512 \
  --train_batch_size=1 \
  --gradient_accumulation_steps=1 \
  --learning_rate=5e-6 \
  --lr_scheduler="constant" \
  --lr_warmup_steps=0 \
  --num_class_images=200 \
  --max_train_steps=800

```

and here is the output of my accelerate config file:

```auto
base_job_name: accelerate-sagemaker-1
compute_environment: AMAZON_SAGEMAKER
distributed_type: 'NO'
ec2_instance_type: ml.p3.2xlarge
iam_role_name: accelerate_sagemaker_execution_role
image_uri: null
mixed_precision: FP16
num_machines: 1
profile: null
py_version: py38
pytorch_version: 1.10.2
region: us-east-1
sagemaker_inputs_file: null
sagemaker_metrics_file: null
transformers_version: 4.17.0
use_cpu: false

```

Any clues on what I could be doing wrong?

To zoom out, what I am trying to achieve is fine-tune Dreambooth on Sagemaker and save the resulting artifacts on S3.

Thank you for your time and assistance! 🤗

---

<div class="post-metadata">

**Author:** ![muellerzr](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/muellerzr/32/21583_2.png) [@muellerzr](https://discuss.huggingface.co/u/muellerzr)\
**Post date:** [October 9, 2022, 4:14pm UTC](https://discuss.huggingface.co/t/sagemakerconfig-object-has-no-attribute-gpu-ids/24174/2 "2022-10-09T16:14:34Z")

</div>

Whats your version of accelerate?

---

<div class="post-metadata">

**Author:** ![jadechip](https://avatars.discourse-cdn.com/v4/letter/j/82dd89/32.png) [@jadechip](https://discuss.huggingface.co/u/jadechip)\
**Post date:** [October 9, 2022, 4:41pm UTC](https://discuss.huggingface.co/t/sagemakerconfig-object-has-no-attribute-gpu-ids/24174/3 "2022-10-09T16:41:19Z")

</div>

Version: 0.14.0.dev0

---

<div class="post-metadata">

**Author:** ![muellerzr](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/muellerzr/32/21583_2.png) [@muellerzr](https://discuss.huggingface.co/u/muellerzr)\
**Post date:** [October 9, 2022, 9:25pm UTC](https://discuss.huggingface.co/t/sagemakerconfig-object-has-no-attribute-gpu-ids/24174/4 "2022-10-09T21:25:08Z")

</div>

Thanks @jadechip, can you try using accelerate installed via:

```bash
pip install git+https://github.com/huggingface/accelerate@fix-config

```

please? Thank you! 🙂

---

<div class="post-metadata">

**Author:** ![jadechip](https://avatars.discourse-cdn.com/v4/letter/j/82dd89/32.png) [@jadechip](https://discuss.huggingface.co/u/jadechip)\
**Post date:** [October 11, 2022, 5:50am UTC](https://discuss.huggingface.co/t/sagemakerconfig-object-has-no-attribute-gpu-ids/24174/5 "2022-10-11T05:50:38Z")

</div>

@muellerzr Thank you so much for your help with this! The version you mention, and also version accelerate==0.12.0 both worked, so there might be something wrong with the 0.14.0.dev0 build.

---

<div class="post-metadata">

**Author:** ![muellerzr](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/muellerzr/32/21583_2.png) [@muellerzr](https://discuss.huggingface.co/u/muellerzr)\
**Post date:** [October 12, 2022, 11:43pm UTC](https://discuss.huggingface.co/t/sagemakerconfig-object-has-no-attribute-gpu-ids/24174/6 "2022-10-12T23:43:40Z")

</div>

This has now been solved on main 🙂 thanks for your patience!
