thevasudevgupta / gsoc-wav2vec2

GSoC'2021 | TensorFlow implementation of Wav2Vec2
https://thevasudevgupta.github.io/gsoc-wav2vec2/assets/final_report
Apache License 2.0
88 stars 29 forks source link

some issue with running sample notebook #24

Closed alighofrani95 closed 2 years ago

alighofrani95 commented 2 years ago

By running the below code

processor = Wav2Vec2Processor(is_tokenizer=False)
tokenizer = Wav2Vec2Processor(is_tokenizer=True)
model = Wav2Vec2ForCTC.from_pretrained("vasudevgupta/finetuned-wav2vec2-960h")

this is happening, Is it related to incompatible package versioning?

Loading weights locally from vasudevgupta/finetuned-wav2vec2-960h

ValueError                                Traceback (most recent call last)
<ipython-input-12-84c97bf7852e> in <module>()
      1 processor = Wav2Vec2Processor(is_tokenizer=False)
      2 tokenizer = Wav2Vec2Processor(is_tokenizer=True)
----> 3 model = Wav2Vec2ForCTC.from_pretrained("vasudevgupta/finetuned-wav2vec2-960h")

8 frames
/usr/local/lib/python3.7/dist-packages/wav2vec2/tensorflow_addons.py in build(self, input_shape)
     22 
     23     def build(self, input_shape):
---> 24         super().build(input_shape)
     25 
     26         kernel_norm_axes = list(range(self.kernel.shape.rank))

ValueError: Exception encountered when calling layer "pos_conv_embed" (type PositionalConvEmbedding).

One of the dimensions in the output is <= 0 due to downsampling in conv. Consider increasing the input size. Received input shape [1, 6, 768] which would produce output shape with a zero or negative value in a dimension.

Call arguments received:
  • batch=tf.Tensor(shape=(1, 6, 768), dtype=float32)
alighofrani95 commented 2 years ago

by downgrading tf to 2.5 problem solved