# Optimum/Neuron: RuntimeError: forward() is missing value for argument 'argument\_4'

**URL:** <https://discuss.huggingface.co/t/optimum-neuron-runtimeerror-forward-is-missing-value-for-argument-argument-4/101943>\
**Category:** 🤗Optimum\
**Created:** [August 12, 2024, 5:34am UTC](https://discuss.huggingface.co/t/optimum-neuron-runtimeerror-forward-is-missing-value-for-argument-argument-4/101943 "2024-08-12T05:34:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![hgfckwla](https://avatars.discourse-cdn.com/v4/letter/h/f05b48/32.png) [@hgfckwla](https://discuss.huggingface.co/u/hgfckwla)\
**Post date:** [August 12, 2024, 5:34am UTC](https://discuss.huggingface.co/t/optimum-neuron-runtimeerror-forward-is-missing-value-for-argument-argument-4/101943/1 "2024-08-12T05:34:28Z")

</div>

I’m trying to render an image on AWS Inferentia2 using Optimum NeuronX. I have converted [juggernautXL\_v8Rundiffusion](https://civitai.com/models/133005?modelVersionId=288982) model to the Diffusers format using [sdxl-to-diffusers-v2](https://huggingface.co/spaces/John6666/sdxl-to-diffusers-v2) and then to Neuron format with:

```auto
optimum-cli export neuron \
    --model juggernautXL_v8Rundiffusion \
    --task stable-diffusion-xl \
    --batch_size 1 --num_images_per_prompt 1 \
    --height 1024 --width 1024 \
    juggernautXL_v8Rundiffusion_neuron

```

Then I’m trying to generate an image with this Python code:

```python
from optimum.neuron import NeuronStableDiffusionPipeline
stable_diffusion = NeuronStableDiffusionPipeline.from_pretrained(model_path)
image = stable_diffusion(prompt).images[0]

```

But it fails with:

```plaintext
RuntimeError: forward() is missing value for argument 'argument_4'. 
Declaration: forward( __torch__.torch_neuronx.xla_impl.trace.___torch_mangle_11.NeuronModule self, 
Tensor argument_1, Tensor argument_2, Tensor argument_3, Tensor argument_4, Tensor argument_5)
-> ((Tensor))

```

Any idea why? Do I need any other parameters other than `prompt` in the inference step?

---

<div class="post-metadata">

**Author:** ![hgfckwla](https://avatars.discourse-cdn.com/v4/letter/h/f05b48/32.png) [@hgfckwla](https://discuss.huggingface.co/u/hgfckwla)\
**Post date:** [August 13, 2024, 9:18pm UTC](https://discuss.huggingface.co/t/optimum-neuron-runtimeerror-forward-is-missing-value-for-argument-argument-4/101943/2 "2024-08-13T21:18:15Z")

</div>

Figured it out. It’s a SDXL model so needed to use `NeuronStableDiffusionXLPipeline` instead of `NeuronStableDiffusionPipeline`.

Just in case someone comes across this too.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/hellohellohello/original/2X/d/de4155eb4aa4108ecb32a1389d7cc37ae69f88b7.png) [@system](https://discuss.huggingface.co/u/system)\
**Post date:** [August 14, 2024, 9:18am UTC](https://discuss.huggingface.co/t/optimum-neuron-runtimeerror-forward-is-missing-value-for-argument-argument-4/101943/3 "2024-08-14T09:18:40Z")

</div>

Closed on August 14, 2024, 9:18am UTC

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.
