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] Kaggle Dog Explicitly move to cpu before plotting #1966

Merged
merged 1 commit into from
Feb 14, 2022

Conversation

AnirudhDagar
Copy link
Member

Fix TypeError: can’t convert CUDA tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first.

Please DO NOT MERGE this yet.

Description of changes:

By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice.

Fix TypeError: can’t convert CUDA tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first
@mli
Copy link
Member

mli commented Nov 18, 2021

Job d2l-en/PR-1966/1 is complete.
Check the results at http://preview.d2l.ai/d2l-en/PR-1966/

@astonzhang
Copy link
Member

Sure. We won't merge until we dive deep to find out the root cause...

@mli
Copy link
Member

mli commented Dec 3, 2021

Job d2l-en/PR-1966/2 is complete.
Check the results at http://preview.d2l.ai/d2l-en/PR-1966/

@AnirudhDagar AnirudhDagar changed the title [DO NOT MERGE] Kaggle Dog Explicitly move to cpu before plotting [PyTorch] Kaggle Dog Explicitly move to cpu before plotting Feb 14, 2022
@AnirudhDagar
Copy link
Member Author

We should merge this now @astonzhang. Root cause explained in #2044

@astonzhang astonzhang merged commit 420f6f9 into master Feb 14, 2022
@astonzhang astonzhang deleted the fix-TypeError branch February 14, 2022 20:07
AnirudhDagar added a commit to AnirudhDagar/d2l-en that referenced this pull request Mar 2, 2022
Fix TypeError: can’t convert CUDA tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first
astonzhang pushed a commit that referenced this pull request Mar 7, 2022
* Explicitly move to cpu before plotting (#1966)

Fix TypeError: can’t convert CUDA tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first

* [MXNet] Fix plots with numpy>=1.20

* [CI] Use cuda 10.2 and 11.2; bump tf==2.8.0

* MAINT: Update dependencies

* [CI] Bump torch==1.10.2 and torchvision==0.11.3 (#2051)

* [CI] Bump torch==1.10.2 and torchvision==0.11.3

* [PyTorch] Fix 1.10.2 support; cast boolean type to float before mean

* MAINT: Use d2l-worker node for build

* d2lbook clear and rebuild

* CI: Remove d2lbook clear

* Remove imported members from d2l API

This will also fix the issue described in #2055 (comment)
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.

3 participants