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

moved exceptions from training #1260

Merged
merged 3 commits into from
Jul 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from contextlib import redirect_stdout
from super_gradients.common.abstractions.abstract_logger import get_logger
from super_gradients.training.datasets.detection_datasets.detection_dataset import DetectionDataset
from super_gradients.training.exceptions.dataset_exceptions import DatasetValidationException, ParameterMismatchException
from super_gradients.common.exceptions.dataset_exceptions import DatasetValidationException, ParameterMismatchException
from super_gradients.training.datasets.data_formats.default_formats import XYXY_LABEL

logger = get_logger(__name__)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from super_gradients.training.utils.detection_utils import get_cls_posx_in_target
from super_gradients.common.abstractions.abstract_logger import get_logger
from super_gradients.training.transforms.transforms import DetectionTransform, DetectionTargetsFormatTransform, DetectionTargetsFormat
from super_gradients.training.exceptions.dataset_exceptions import EmptyDatasetException, DatasetValidationException
from super_gradients.common.exceptions.dataset_exceptions import EmptyDatasetException, DatasetValidationException
from super_gradients.common.factories.list_factory import ListFactory
from super_gradients.common.factories.transforms_factory import TransformsFactory
from super_gradients.training.datasets.data_formats.default_formats import XYXY_LABEL
Expand Down
2 changes: 1 addition & 1 deletion src/super_gradients/training/datasets/mixup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import torch

from super_gradients.common.registry.registry import register_collate_function
from super_gradients.training.exceptions.dataset_exceptions import IllegalDatasetParameterException
from super_gradients.common.exceptions.dataset_exceptions import IllegalDatasetParameterException


def one_hot(x, num_classes, on_value=1.0, off_value=0.0, device="cuda"):
Expand Down
Empty file.
2 changes: 1 addition & 1 deletion src/super_gradients/training/kd_trainer/kd_trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from super_gradients.common.abstractions.abstract_logger import get_logger
from super_gradients.training import utils as core_utils, models
from super_gradients.training.dataloaders import dataloaders
from super_gradients.training.exceptions.kd_trainer_exceptions import (
from super_gradients.common.exceptions.kd_trainer_exceptions import (
ArchitectureKwargsException,
UnsupportedKDArchitectureException,
InconsistentParamsException,
Expand Down
2 changes: 1 addition & 1 deletion src/super_gradients/training/losses/ohem_ce_loss.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import torch
from torch import nn
from torch.nn.modules.loss import _Loss
from super_gradients.training.exceptions.loss_exceptions import IllegalRangeForLossAttributeException, RequiredLossComponentReductionException
from super_gradients.common.exceptions.loss_exceptions import IllegalRangeForLossAttributeException, RequiredLossComponentReductionException


class OhemLoss(_Loss):
Expand Down
2 changes: 1 addition & 1 deletion src/super_gradients/training/sg_trainer/sg_trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

from super_gradients.training import utils as core_utils, models, dataloaders
from super_gradients.training.datasets.samplers import RepeatAugSampler
from super_gradients.training.exceptions.sg_trainer_exceptions import UnsupportedOptimizerFormat
from super_gradients.common.exceptions.sg_trainer_exceptions import UnsupportedOptimizerFormat
from super_gradients.training.metrics.metric_utils import (
get_metrics_titles,
get_metrics_results_tuple,
Expand Down
2 changes: 1 addition & 1 deletion src/super_gradients/training/utils/sg_trainer_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from torch.utils.tensorboard import SummaryWriter

from super_gradients.common.environment.device_utils import device_config
from super_gradients.training.exceptions.dataset_exceptions import UnsupportedBatchItemsFormat
from super_gradients.common.exceptions.dataset_exceptions import UnsupportedBatchItemsFormat
from super_gradients.common.data_types.enum import MultiGPUMode


Expand Down
2 changes: 1 addition & 1 deletion tests/integration_tests/detection_dataset_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from super_gradients.training.datasets import PascalVOCDetectionDataset, COCODetectionDataset
from super_gradients.training.transforms import DetectionMosaic, DetectionPaddedRescale, DetectionTargetsFormatTransform
from super_gradients.training.datasets.data_formats.default_formats import XYXY_LABEL
from super_gradients.training.exceptions.dataset_exceptions import EmptyDatasetException
from super_gradients.common.exceptions.dataset_exceptions import EmptyDatasetException
from super_gradients.common.environment.path_utils import normalize_path


Expand Down
2 changes: 1 addition & 1 deletion tests/unit_tests/detection_dataset_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from super_gradients.training.datasets import COCODetectionDataset
from super_gradients.training.datasets.data_formats.default_formats import LABEL_CXCYWH
from super_gradients.training.datasets.datasets_conf import COCO_DETECTION_CLASSES_LIST
from super_gradients.training.exceptions.dataset_exceptions import DatasetValidationException, ParameterMismatchException
from super_gradients.common.exceptions.dataset_exceptions import DatasetValidationException, ParameterMismatchException
from super_gradients.training.metrics import DetectionMetrics
from super_gradients.training.models import YoloXPostPredictionCallback
from super_gradients.training.transforms import DetectionMosaic, DetectionTargetsFormatTransform, DetectionPaddedRescale
Expand Down
2 changes: 1 addition & 1 deletion tests/unit_tests/detection_sub_classing_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from super_gradients.training.datasets import DetectionDataset
from super_gradients.training.utils.detection_utils import DetectionTargetsFormat
from super_gradients.training.exceptions.dataset_exceptions import EmptyDatasetException, DatasetValidationException
from super_gradients.common.exceptions.dataset_exceptions import EmptyDatasetException, DatasetValidationException


class DummyDetectionDataset(DetectionDataset):
Expand Down