diff --git a/notebooks/camera_ready/corrupt_data/pretrain.py b/notebooks/camera_ready/corrupt_data/pretrain.py index e7f301f..0d2fd62 100644 --- a/notebooks/camera_ready/corrupt_data/pretrain.py +++ b/notebooks/camera_ready/corrupt_data/pretrain.py @@ -6,9 +6,9 @@ import lightning.pytorch as pl import torch +import wandb from lightning.fabric.strategies import XLAFSDPStrategy -import wandb from sdofm import utils from sdofm.datasets import (BrightSpotsSDOMLDataModule, HelioProjectedSDOMLDataModule, SDOMLDataModule) diff --git a/notebooks/camera_ready/instrument_degrad/pretrain.py b/notebooks/camera_ready/instrument_degrad/pretrain.py index e7f301f..0d2fd62 100644 --- a/notebooks/camera_ready/instrument_degrad/pretrain.py +++ b/notebooks/camera_ready/instrument_degrad/pretrain.py @@ -6,9 +6,9 @@ import lightning.pytorch as pl import torch +import wandb from lightning.fabric.strategies import XLAFSDPStrategy -import wandb from sdofm import utils from sdofm.datasets import (BrightSpotsSDOMLDataModule, HelioProjectedSDOMLDataModule, SDOMLDataModule) diff --git a/notebooks/camera_ready/virtual_eve/pretrain.py b/notebooks/camera_ready/virtual_eve/pretrain.py index e7f301f..0d2fd62 100644 --- a/notebooks/camera_ready/virtual_eve/pretrain.py +++ b/notebooks/camera_ready/virtual_eve/pretrain.py @@ -6,9 +6,9 @@ import lightning.pytorch as pl import torch +import wandb from lightning.fabric.strategies import XLAFSDPStrategy -import wandb from sdofm import utils from sdofm.datasets import (BrightSpotsSDOMLDataModule, HelioProjectedSDOMLDataModule, SDOMLDataModule) diff --git a/scripts/ablation.py b/scripts/ablation.py index eeca064..74b48c8 100644 --- a/scripts/ablation.py +++ b/scripts/ablation.py @@ -5,8 +5,8 @@ import lightning.pytorch as pl import torch - import wandb + from sdofm import utils from sdofm.ablation import AblationAutocalibration from sdofm.datasets import DegradedSDOMLDataModule, SDOMLDataModule diff --git a/scripts/finetune.py b/scripts/finetune.py index b98beaf..1a47333 100644 --- a/scripts/finetune.py +++ b/scripts/finetune.py @@ -5,8 +5,8 @@ import lightning.pytorch as pl import torch - import wandb + from sdofm import utils from sdofm.datasets import DegradedSDOMLDataModule, SDOMLDataModule from sdofm.finetuning import Autocalibration, VirtualEVE diff --git a/scripts/main.py b/scripts/main.py index 2b57986..9793a97 100644 --- a/scripts/main.py +++ b/scripts/main.py @@ -12,11 +12,11 @@ import hydra import numpy as np import torch +import wandb from lightning.pytorch import seed_everything from lightning.pytorch.loggers.wandb import WandbLogger from omegaconf import DictConfig, OmegaConf -import wandb from sdofm import utils # import days_hours_mins_secs_str from sdofm.utils import flatten_dict diff --git a/scripts/main_tf.py b/scripts/main_tf.py index c26edd8..2dbb654 100755 --- a/scripts/main_tf.py +++ b/scripts/main_tf.py @@ -11,11 +11,11 @@ import hydra import numpy as np import tensorflow as tf +import wandb # from lightning.pytorch import seed_everything # from lightning.pytorch.loggers.wandb import WandbLogger from omegaconf import DictConfig, OmegaConf -import wandb from sdofm import utils # import days_hours_mins_secs_str from sdofm.utils import flatten_dict diff --git a/scripts/pretrain.py b/scripts/pretrain.py index e8cf616..d370fe4 100755 --- a/scripts/pretrain.py +++ b/scripts/pretrain.py @@ -6,9 +6,9 @@ import lightning.pytorch as pl import torch +import wandb from lightning.fabric.strategies import XLAFSDPStrategy -import wandb from sdofm import utils from sdofm.datasets import (BrightSpotsSDOMLDataModule, HelioProjectedSDOMLDataModule, diff --git a/sdofm/models/wrap_encoder.py b/sdofm/models/wrap_encoder.py index 9eeadb2..82f6586 100644 --- a/sdofm/models/wrap_encoder.py +++ b/sdofm/models/wrap_encoder.py @@ -7,13 +7,12 @@ import segmentation_models_pytorch as smp import torch import torch.nn as nn +import wandb from einops import rearrange from omegaconf import DictConfig, OmegaConf from segmentation_models_pytorch import Unet from segmentation_models_pytorch.decoders.unet.decoder import UnetDecoder -import wandb - from .. import utils from . import ConvTransformerTokensToEmbeddingNeck, MaskedAutoencoderViT3D diff --git a/sdofm/pretraining/MAE.py b/sdofm/pretraining/MAE.py index d8e04b4..7258476 100644 --- a/sdofm/pretraining/MAE.py +++ b/sdofm/pretraining/MAE.py @@ -107,9 +107,8 @@ def on_validation_epoch_end(self): batch_metrics = bench_recon.mean_metrics(merged_metrics) if isinstance(self.logger, pl.loggers.wandb.WandbLogger): - from pandas import DataFrame - import wandb + from pandas import DataFrame # this only occurs on rank zero only df = DataFrame(batch_metrics) diff --git a/sdofm/utils.py b/sdofm/utils.py index c8537c5..a138f41 100755 --- a/sdofm/utils.py +++ b/sdofm/utils.py @@ -7,7 +7,6 @@ import numpy as np import torch - import wandb