huggingface / transformers

🤗 Transformers: State-of-the-art Machine Learning for Pytorch, TensorFlow, and JAX.
https://huggingface.co/transformers
Apache License 2.0
135.41k stars 27.1k forks source link

modeling_xlnet.py:283: UserWarning: Mixed memory format inputs detected while calling the operator. #7120

Closed fhamborg closed 3 years ago

fhamborg commented 4 years ago

Environment info

Who can help

@TevenLeScao

Information

Model I am using (Bert, XLNet ...): xlnet-base-uncased

The problem arises when using:

The tasks I am working on is:

To reproduce

Steps to reproduce the behavior:

  1. Simply invoke XLNet using the following
last_hidden_state, mems = lm(
                input_ids=input_ids,
                token_type_ids=token_type_ids,
                output_hidden_states=True,
            )

I receive a warning as follows:

...\anaconda3\envs\newstsc2\lib\site-packages\transformers\modeling_xlnet.py:283: UserWarning: Mixed memory format inputs detected while calling the operator. The operator will output contiguous tensor even if some of the inputs are in channels_last format. (Triggered internally at  ..\aten\src\ATen\native\TensorIterator.cpp:918.)
  attn_score = (ac + bd + ef) * self.scale

Expected behavior

no warning

TevenLeScao commented 4 years ago

Hey! I haven't been able to reproduce this with what you've given, maybe it is linked to your 'token_type_ids' ? I don't really have enough info on what you're trying to do with only this line. In any case:

mihaidobri commented 4 years ago

@TevenLeScao FYI: I have the same warning message, on Colab,using Xlnet-base-cased (custom script , custom dataset)

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.