# Train encoder/decoder error

**URL:** <https://discuss.huggingface.co/t/train-encoder-decoder-error/20441>\
**Category:** Beginners\
**Created:** [July 15, 2022, 9:01pm UTC](https://discuss.huggingface.co/t/train-encoder-decoder-error/20441 "2022-07-15T21:01:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lokiii](https://avatars.discourse-cdn.com/v4/letter/l/e47774/32.png) [@Lokiii](https://discuss.huggingface.co/u/Lokiii)\
**Post date:** [July 15, 2022, 9:01pm UTC](https://discuss.huggingface.co/t/train-encoder-decoder-error/20441/1 "2022-07-15T21:01:13Z")

</div>

I get this error with train() while trying to figure out how to fine tune a translation model.

```auto
/usr/local/lib/python3.7/dist-packages/transformers/models/marian/modeling_marian.py in forward(self, input_ids, attention_mask, encoder_hidden_states, encoder_attention_mask, head_mask, cross_attn_head_mask, past_key_values, inputs_embeds, use_cache, output_attentions, output_hidden_states, return_dict)
    964 input_shape = inputs_embeds.size()[:-1]
    965 else:
--> 966 raise ValueError("You have to specify either decoder_input_ids or decoder_inputs_embeds")
    967 
    968 # past_key_values_length

ValueError: You have to specify either decoder_input_ids or decoder_inputs_embeds

```

Here the googlecolab, can someone please tell me what’s wrong with the code?  
[https://colab.research.google.com/drive/1KnwhklR150HOmHypFmYsbYJGTHvGeJqd?usp=sharing](https://colab.research.google.com/drive/1KnwhklR150HOmHypFmYsbYJGTHvGeJqd?usp=sharing)

---

<div class="post-metadata">

**Author:** ![Lokiii](https://avatars.discourse-cdn.com/v4/letter/l/e47774/32.png) [@Lokiii](https://discuss.huggingface.co/u/Lokiii)\
**Post date:** [July 16, 2022, 5:26pm UTC](https://discuss.huggingface.co/t/train-encoder-decoder-error/20441/2 "2022-07-16T17:26:17Z")

</div>

Please, someone can help? I really need this 🥲
