-
Notifications
You must be signed in to change notification settings - Fork 378
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
Deps: make omegaconf/tensorboard optional #1214
Conversation
28a6028
to
e38e6ab
Compare
@@ -72,7 +72,7 @@ jobs: | |||
- name: Install pip dependencies | |||
if: steps.cache.outputs.cache-hit != 'true' | |||
run: | | |||
pip install .[docs,tests] planetary_computer pystac pytest-rerunfailures tensorboard | |||
pip install .[docs,tests] planetary_computer pystac pytest-rerunfailures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The rest of these are things that we could subsume into [tests]
, but they're also dependencies that I would like to remove in the future, and I don't think they're worth tracking.
I think having tensorboard inside the notebooks isn't necessary (this is why I used CSV logger at one point). So removing those and depending on tensorboardX is fine with me. Put differently, tensorboard in notebooks isn't really necessary for showing people the features of torchgeo. |
7a0bd8a
to
72752f5
Compare
You should try the new trainers tutorial, it's beautiful. The CSV logger is an extra 20 lines of code and makes it seem like using TorchGeo is way harder than it actually is. No user should ever have to manually parse a CSV file and make their own loss/accuracy plots. |
I get that it looks cool :), but notebooks aren't really the environment for running organized experiments. In my mind the tutorials are to show off what torchgeo can do, the point of showing the loss at all is "it goes down, training is working" not showing the logging capabilities of lightning |
For sure, but the point of the tutorials is also not to teach you how to parse and plot a CSV file. The tutorials should be the bare minimum lines of code. The previous tutorial had more lines for plotting than it did for training. Now plotting is a single line of tensorboard. |
(but, as a consequence, brings in more dependencies) |
Also, I don't care one way or the other, just suggesting a path for using tensorboardX (also, we could probably plot from CSV with fewer lines if that's the metric -- I love a good code golf problem ;)) |
I might open an issue with tensorboardX and see if they have any interest in Jupyter support. That project is confusing to me, it seems crazy to try to maintain feature parity with such a large library as tensorboard. |
* Deps: make omegaconf/tensorboard optional * Bump minimum tensorboard * Remove explicit tensorboard install from GitHub Actions * Fix typo
* Deps: make omegaconf/tensorboard optional * Bump minimum tensorboard * Remove explicit tensorboard install from GitHub Actions * Fix typo
Why optional?
TorchGeo does not import or require either of these dependencies. The only thing these deps are required for is our trainer tests, for a single notebook, and for train.py and friends. None of these files get installed when you run
pip install torchgeo
, so the dependency shouldn't be required.Why now?
Omegaconf was always an issue (every time you update the conda-forge recipe it complains that it isn't used), but the lightning/tensorboard issue is relatively new. Starting with lightning 1.9, tensorboard was moved from a required dependency to an optional extra. However, our tests need tensorboard for coverage, so we added a dependency on
lightning[extra]
to pull in tensorboard. However, this pulls in a lot of other deps in addition to tensorboard. To minimize the deps we install, we should avoid using[extra]
.Also, Spack has trouble concretizing
py-lightning+extra
due to conflicting setuptools versions required.Why tensorboard and not tensorboardX?
Lightning used to install tensorboard, then switched to tensorboardX (both are compatible with the same API). The reason for this switch was that tensorboardX has fewer dependencies and is easier to install on more platforms. The only other difference I've seen between the two that affects us is that tensorboardX does not support the
%load_ext tensorboard
Jupyter magic that we use in our notebook. Since our notebook tests require tensorboard, I figured we should just go with that.FYI @bugraaldal