Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GenerateText method have no attribute model #1260

Open
rishabhrahulcom opened this issue Mar 17, 2024 · 1 comment
Open

GenerateText method have no attribute model #1260

rishabhrahulcom opened this issue Mar 17, 2024 · 1 comment

Comments

@rishabhrahulcom
Copy link

GenerateText method in "image_captioning" in https://www.tensorflow.org/text/tutorials/image_captioning have no attribute model.
Screenshot 2024-03-17 at 3 58 51 PM

@rishabhrahulcom
Copy link
Author

Fixing it by adding a attribute _model in GenerateText() function

super().__init__() 
    self._model = None 
Screenshot 2024-03-17 at 4 02 17 PM

This will leads to type cast issue in masked_loss() function
so casting it to int32.
def masked_loss(labels, preds): labels = tf.cast(labels, tf.int32)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant