Skip to content

A small mistake in translator.py #971

Closed
@LanceNorskog

Description

This came when running the German->English model:
iwslt-brnn2.s131_acc_62.71_ppl_7.74_e20.pt

/content/OpenNMT-py/onmt/translate/translation.py:48: UserWarning: invalid index of a 0-dim tensor. This will be an error in PyTorch 0.5. Use tensor.item() to convert a 0-dim tensor to a Python number
tokens[i] = src_raw[max_index[0]]

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions