AttributeError: module 'tensorflow' has no attribute 'repeat'
I tried to run the pipeline task 'summarization', but get a error with "module **'tensorflow' has no attribute 'repeat' "** Does anyone encountered the same problem? How to fix it?

**my installed tensorflow == 2.0.0**

error messages:
/home/ww/anaconda3/envs/environment_name/lib/python3.6/site-packages/transformers/pipelines.py", line 1446, in __call__
    inputs["input_ids"], attention_mask=inputs["attention_mask"], **generate_kwargs,
  File "/home/ww/anaconda3/envs/environment_name/lib/python3.6/site-packages/transformers/modeling_tf_utils.py", line 747, in generate
    tf.repeat(tf.expand_dims(tf.range(batch_size), -1), repeats=num_beams * effective_batch_mult, axis=1),
AttributeError: module 'tensorflow' has no attribute 'repeat'

@LysandreJik @jplu 

It seems that Tensorflow does not include `repeat`  in 2.0 and 2.0.1 (see https://github.com/tensorflow/tensorflow/issues/38839). Perhaps best to have 2.1 as a min requirement?<|||||>Indeed, TF < 2.1 doesn't have the `tf.repeat()` function. Put TF >= 2.1 as min requirement looks to be a good solution to me.

@LysandreJik are you ok with this?<|||||>Yeah I checked tensorflow API and upgrade my tf yo 2.2 it works now


On 25 Jun 2020, at 4:50 pm, Julien Plu <notifications@github.com> wrote:

﻿

Indeed, TF < 2.1 doesn't have the tf.repeat() function. Put TF >= 2.1 as min requirement looks to be a good solution to me.

@LysandreJik<https://github.com/LysandreJik> are you ok with this?

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<https://github.com/huggingface/transformers/issues/5218#issuecomment-649272046>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AKTGDOKKTAPDE6SIYCKGTO3RYLXTNANCNFSM4OF2P2IQ>.
<|||||>Sure, I'm okay with this!