tensorflow / models

Models and examples built with TensorFlow
Other
77.23k stars 45.75k forks source link

RMS_Norm operand #11256

Open Samir-atra opened 2 months ago

Samir-atra commented 2 months ago

Prerequisites

Please answer the following questions for yourself before submitting an issue.

1. The entire URL of the file you are using

https://github.com/tensorflow/models/blob/master/official/nlp/modeling/layers/transformer_encoder_block.py

2. Describe the bug

when I install the tensorflow models package using the command pip3 install tf-models-official and try to import it using import tensorflow_models as tfm

I get a type error and as follows:

TypeError: unsupported operand type(s) for |: 'type' and '_GenericAlias'

3. Steps to reproduce

install the tensorflow model garden using pip and then try to import it to your project.

4. Expected behavior

I expected the model to be loaded and code execution finishes

5. Additional context

I tried to install the 2.16.0 version which is one version older then tried to install the current nightly version but still I get the same error.

6. System information

bharatjetti commented 2 months ago

Hi @Samir-atra Thanks for reporting the issue. I was able to reproduce this issue, it is due to new typing feature of python 3.10. I've opened a PR #11259 to make tensorflow_models compatible with python3.7+.

Samir-atra commented 2 months ago

Hello, @bharatjetti great to hear that you have solved it. Thanks and Kind regards Samer