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

♻️ Refresh code to work with 2024 library versions #3

Merged
merged 9 commits into from
Nov 3, 2024

Conversation

weiji14
Copy link
Owner

@weiji14 weiji14 commented Nov 1, 2024

Updating various dependencies to 2024 versions, and refactoring the codebase to work with those new versions!

TODO:

  • Improve installation instructions on main README.md
  • Update dependency versions in conda environment.yml and lock files
  • Fix errors due to new library version API changes
  • Create lockfiles for Linux (CUDA) and and macOS M1/M2/M3 chips (OSX-ARM64)

Some more getting started instructions to install the package, and updated the quickstart button from Pangeo Binder to regular Binder.
Upgrading pytorch, torchvision and other dependencies to newer versions in 2024. Simplified the conda environment.yml file to use conda-forge channel only and remove the md5 hash (put in the lock file instead). Not installing black and codecarbon as required dependencies anymore. Installing ONNX so model export will work.
Fix the following errors

- AttributeError: type object 'Trainer' has no attribute 'add_argparse_args' (need to change from Pytorch Lightning 1.0 to Lightning 2.0 style, see Lightning-AI/pytorch-lightning#19905)
- ValueError: Cannot find 8ef2e2d423b67b53ec8113fc71a9b968bb0f66e7 in https://github.com/mateuszbuda/brain-segmentation-pytorch (change to use v1.0 tag)
- AttributeError: module 'torchmetrics' has no attribute 'IoU' (renamed to JaccardIndex, see Lightning-AI/torchmetrics#662)

Also gitignoring __pycache__/ folder.
@weiji14 weiji14 self-assigned this Nov 1, 2024
Copy link

dagshub bot commented Nov 1, 2024

Bumps [conda-incubator/setup-miniconda](https://github.com/conda-incubator/setup-miniconda) from 2.2.0 to 3.0.4.
- [Release notes](https://github.com/conda-incubator/setup-miniconda/releases)
- [Changelog](https://github.com/conda-incubator/setup-miniconda/blob/main/CHANGELOG.md)
- [Commits](conda-incubator/setup-miniconda@v2.2.0...v3.0.4)

Also bumped actions/checkout from v2.3.4 to v4.2.2, and ubuntu from 20.04 to 24.04. Commented out `black` code quality check for now.
Getting this error on CI: `ParseError: Could not parse explicit URL: https://conda.anaconda.org/conda-forge/linux-64/_libgcc_mutex-0.1-conda_forge.tar.bz2#fe51de6107f9edc7aa4f786a70f4a883943bc9d39b3bb7307c04c41410990726`. Try without the sha256 hashsum suffix to see if setup-miniconda works.
Assuming that mateuszbuda/brain-segmentation-pytorch is a trusted source to download the UNet model, so that Continuous Integration can work without a Y/N prompt.
Fix `AttributeError: 'ExperimentWriter' object has no attribute 'add_scalar'` by gating the `self.logger.experiment.add_scalar` call behind an if-condition. Logging can be activated if tensorboard is installed, and the `--logger=True` flag is passed via the command-line.
Include a teaser image of a sediment core with Ice-Rafted Debris (IRD) clasts highlighted in red to the main README.md file. Also fixed a small typo.
Re-created conda environment by running `CONDA_OVERRIDE_CUDA=12.6 conda env create --file=environment.yml --solver=libmamba` and re-locking with `conda list --explicit > environment-linux-64.lock`. Unsure why it's giving us CUDA 11.8 instead of CUDA 12, but oh well.
@weiji14 weiji14 marked this pull request as ready for review November 3, 2024 09:49
@weiji14
Copy link
Owner Author

weiji14 commented Nov 3, 2024

  • Create lockfiles for Linux (CUDA) and and macOS M1/M2/M3 chips (OSX-ARM64)

Refreshed lockfile on linux-64 with CUDA-enabled Pytorch from conda-forge, but not yet for osx-arm64, need to check if Pytorch on conda-forge (https://github.com/conda-forge/pytorch-cpu-feedstock) has a proper osx-arm64 build which utilizes the Mac M1/M2/M3 Apple Silicon chips.

@weiji14 weiji14 merged commit fdd906a into main Nov 3, 2024
1 check passed
@weiji14 weiji14 deleted the refresh-2024 branch November 3, 2024 09:58
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.

1 participant