ST-P3 icon indicating copy to clipboard operation
ST-P3 copied to clipboard

Migrate Codebase to Latest PyTorch Lightning and NumPy

Open ruddyscent opened this issue 6 months ago • 0 comments

Description:

This PR updates the project to be compatible with the latest version of PyTorch Lightning and NumPy. The key changes include:

  1. Remove Deprecated compute_on_step Argument from Metrics:

    • Updated metric classes to remove the deprecated compute_on_step argument, ensuring they work correctly with the latest TorchMetrics and PyTorch Lightning.
    • Refactored metric initialization and handling to follow current best practices.
  2. Replace Deprecated np.int Usage:

    • Replaced the deprecated use of np.int with the appropriate integer type, ensuring compatibility with newer versions of NumPy.
  3. Update Hyperparameter Handling in TrainingModule:

    • Refactored the TrainingModule class to use self.save_hyperparameters() for managing hyperparameters, replacing the direct assignment of self.hparams. This aligns with the latest PyTorch Lightning guidelines and prevents potential errors.
  4. Migrate Classes to the Latest PyTorch Lightning:

    • Updated several classes and methods to be compatible with the latest PyTorch Lightning API, ensuring smooth operation and future-proofing the codebase.
  5. Add requirements.txt to Specify Project Dependencies:

    • Introduced a requirements.txt file to clearly define and manage the project's dependencies.

Testing:

These changes have been tested and confirmed to work within containers based on the nvcr.io/nvidia/pytorch:24.07-py3 image. This ensures compatibility and smooth integration in the specified environment.

ruddyscent avatar Aug 14 '24 02:08 ruddyscent