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

PyTorch warnings: Tensor.data<T>() is deprecated. #456

Closed
tomrunia opened this issue Aug 27, 2019 · 2 comments
Closed

PyTorch warnings: Tensor.data<T>() is deprecated. #456

tomrunia opened this issue Aug 27, 2019 · 2 comments

Comments

@tomrunia
Copy link

tomrunia commented Aug 27, 2019

After building both PyTorch and Apex from their master branches, my training script throws PyTorch C++ warnings at every training step. All warnings disappear when disabling Apex during training. Installing the official release of PyTorch 1.2 also seems to work without warnings.

/usr/local/lib/python3.5/dist-packages/torch/include/ATen/core/Tensor.h:297: UserWarning: Tensor.data<T>() is deprecated. Please use Tensor.data_ptr<T>() instead.
  TORCH_WARN("Tensor.data<T>() is deprecated. Please use Tensor.data_ptr<T>() instead.");

PyTorch from master: f622ec8084c1778c6943474796efa52e9b9cf695
Apex from master: 78c38db467c378759b4278a4ca8547763da5c91d
CUDA Toolkit: 10.1
CuDNN: 7.1

@mcarilli
Copy link
Contributor

mcarilli commented Sep 5, 2019

This looks annoying, I'll try to repro and fix.

In general we've learned it's annoying to ask users to install a repo separate from Pytorch, especially one that relies on extension builds. I've been focused on getting Amp upstream, to avoid all this in the future. pytorch/pytorch#25081.

The API will be different, as requested by upstream, but more flexible and powerful imo.

mcarilli added a commit that referenced this issue Sep 6, 2019
* Pushing for build tests

* Contrib files

* Removing deprecated checks
@mcarilli
Copy link
Contributor

mcarilli commented Sep 6, 2019

Should be fixed now, please reopen if it still shows deprecation warnings at either compile time or runtime.

@mcarilli mcarilli closed this as completed Sep 6, 2019
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

2 participants