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

Tutorials: replace cell magic with shell command #756

Merged
merged 7 commits into from
Sep 5, 2022
Merged

Conversation

adamjstewart
Copy link
Collaborator

I'm hoping this is what's causing https://github.com/microsoft/torchgeo/runs/8172122269?check_suite_focus=true to fail. Also see treebeardtech/nbmake#80.

When I run the previous code in Google Colab, I see:

UsageError: Line magic function `%nvidia-smi` not found.

From my understanding, both % and ! will let you run shell commands, but % is a cell magic command for which there are only a finite number of mappings (pip and apt are allowed, but not nvidia-smi). The other difference is that ! runs in a subprocess, while % runs in the current process. This is required for something like pip install, but not for something like nvidia-smi.

@adamjstewart adamjstewart added this to the 0.3.1 milestone Sep 3, 2022
@github-actions github-actions bot added the documentation Improvements or additions to documentation label Sep 3, 2022
@adamjstewart
Copy link
Collaborator Author

Second commit is something I missed in #714

@adamjstewart
Copy link
Collaborator Author

Bleh, this fixes Jupyter but breaks nbsphinx. See spatialaudio/nbsphinx#670.

@adamjstewart
Copy link
Collaborator Author

I knew this seemed familiar. I actually broke this (! -> %) back in #226, our first release. This PR attempts to revert that change.

@adamjstewart adamjstewart marked this pull request as draft September 4, 2022 00:26
@adamjstewart adamjstewart marked this pull request as ready for review September 4, 2022 00:35
@adamjstewart
Copy link
Collaborator Author

This fixes some of the issues. I'm still seeing unexplainable errors in https://github.com/microsoft/torchgeo/runs/8172778528?check_suite_focus=true. Basically, torch.cuda.is_available() is returning True, but CUDA doesn't work. Our transforms tutorial explicitly passes things to the GPU if it's available, and our trainers tutorial uses Lightning which does the same. Not sure why torch.cuda.is_available() is lying, and we can't easily reproduce this locally.

@adamjstewart
Copy link
Collaborator Author

This looks promising! github/roadmap#505

@calebrob6
Copy link
Member

This fixes some of the issues. I'm still seeing unexplainable errors in https://github.com/microsoft/torchgeo/runs/8172778528?check_suite_focus=true. Basically, torch.cuda.is_available() is returning True, but CUDA doesn't work. Our transforms tutorial explicitly passes things to the GPU if it's available, and our trainers tutorial uses Lightning which does the same. Not sure why torch.cuda.is_available() is lying, and we can't easily reproduce this locally.

It seems that you have that line backwards device = "cpu" if torch.cuda.is_available() else "cuda", should be "cuda" if torch.cuda.is_available() ...

@adamjstewart adamjstewart merged commit ca0a795 into main Sep 5, 2022
@adamjstewart adamjstewart deleted the docs/transforms branch September 5, 2022 19:18
adamjstewart added a commit that referenced this pull request Sep 5, 2022
* Tutorials: replace cell magic with shell command

* Fix NDVI calls

* Ignore errors in nbmake

* Ignore warning for now

* Tutorials: trainers uses radiant-mlhub dataset

* Revert "Tutorials: trainers uses radiant-mlhub dataset"

This reverts commit 229ab28.

* Reverse CUDA conditional
yichiac pushed a commit to yichiac/torchgeo that referenced this pull request Apr 29, 2023
* Tutorials: replace cell magic with shell command

* Fix NDVI calls

* Ignore errors in nbmake

* Ignore warning for now

* Tutorials: trainers uses radiant-mlhub dataset

* Revert "Tutorials: trainers uses radiant-mlhub dataset"

This reverts commit 229ab28.

* Reverse CUDA conditional
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants