diff --git a/mhcflurry/amino_acid.py b/mhcflurry/amino_acid.py
index 73845bba8dfbcf5dac4cbf7b76d4f1850e7675b3..f8c7047b055b052ecbd9038406481a404c2e4f4f 100644
--- a/mhcflurry/amino_acid.py
+++ b/mhcflurry/amino_acid.py
@@ -153,7 +153,7 @@ def fixed_vectors_encoding(index_encoded_sequences, letter_to_vector_df):
     target_shape = (
         num_sequences, sequence_length, letter_to_vector_df.shape[0])
     result = letter_to_vector_df.iloc[
-        index_encoded_sequences.flatten()
+        index_encoded_sequences.reshape((-1,))
     ].values.reshape(target_shape)
     return result