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

Fix three errors of the tutorial 'Image captioning with visual attention' #1339

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bvantuan
Copy link

  1. To align the same shape with image features
    model = Captioner(tokenizer, feature_extractor=mobilenet, output_layer=output_layer,
    units=256, dropout_rate=0.5, num_layers=2, num_heads=2)
    -->
    model = Captioner(tokenizer, feature_extractor=mobilenet, output_layer=output_layer,
    units=576, dropout_rate=0.5, num_layers=2, num_heads=2)

  2. Utilize the set_model method because property 'model' of 'GenerateText' object has no setter
    g.model = model
    -->
    g.set_model(model)

  3. labels must have the dtype of int32 or int64.
    loss = tf.nn.sparse_softmax_cross_entropy_with_logits(labels, preds)
    -->
    labels = tf.cast(labels, tf.int64)
    loss = tf.nn.sparse_softmax_cross_entropy_with_logits(labels, preds)

Copy link

google-cla bot commented Nov 30, 2024

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

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

Successfully merging this pull request may close these issues.

1 participant