Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

#356 Feature/sg 216 remove dataset interface

Merged
Ghost merged 1 commits into Deci-AI:master from deci-ai:feature/SG-216_remove_dataset_interface
@@ -1,6 +1,6 @@
 import unittest
 import unittest
 
 
-from super_gradients.training.datasets.dataset_interfaces.dataset_interface import ClassificationTestDatasetInterface
+from super_gradients.training.dataloaders.dataloaders import classification_test_dataloader
 from super_gradients.training import Trainer, MultiGPUMode, models
 from super_gradients.training import Trainer, MultiGPUMode, models
 from super_gradients.training.metrics.classification_metrics import Accuracy
 from super_gradients.training.metrics.classification_metrics import Accuracy
 import os
 import os
@@ -9,12 +9,9 @@ from super_gradients.training.utils.quantization_utils import PostQATConversionC
 
 
 class QATIntegrationTest(unittest.TestCase):
 class QATIntegrationTest(unittest.TestCase):
     def _get_trainer(self, experiment_name):
     def _get_trainer(self, experiment_name):
-        dataset_params = {"batch_size": 10}
-        dataset = ClassificationTestDatasetInterface(dataset_params=dataset_params)
         trainer = Trainer(experiment_name,
         trainer = Trainer(experiment_name,
                           model_checkpoints_location='local',
                           model_checkpoints_location='local',
                           multi_gpu=MultiGPUMode.OFF)
                           multi_gpu=MultiGPUMode.OFF)
-        trainer.connect_dataset_interface(dataset)
         model = models.get("resnet18", pretrained_weights="imagenet")
         model = models.get("resnet18", pretrained_weights="imagenet")
         return trainer, model
         return trainer, model
 
 
@@ -47,7 +44,8 @@ class QATIntegrationTest(unittest.TestCase):
             "percentile": 99.99
             "percentile": 99.99
         })
         })
 
 
-        model.train(model=net, training_params=train_params)
+        model.train(model=net, training_params=train_params, train_loader=classification_test_dataloader(),
+                    valid_loader=classification_test_dataloader())
 
 
     def test_qat_transition(self):
     def test_qat_transition(self):
         model, net = self._get_trainer("test_qat_transition")
         model, net = self._get_trainer("test_qat_transition")
@@ -59,7 +57,8 @@ class QATIntegrationTest(unittest.TestCase):
             "percentile": 99.99
             "percentile": 99.99
         })
         })
 
 
-        model.train(model=net, training_params=train_params)
+        model.train(model=net, training_params=train_params, train_loader=classification_test_dataloader(),
+                    valid_loader=classification_test_dataloader())
 
 
     def test_qat_from_calibrated_ckpt(self):
     def test_qat_from_calibrated_ckpt(self):
         model, net = self._get_trainer("generate_calibrated_model")
         model, net = self._get_trainer("generate_calibrated_model")
@@ -71,7 +70,8 @@ class QATIntegrationTest(unittest.TestCase):
             "percentile": 99.99
             "percentile": 99.99
         })
         })
 
 
-        model.train(model=net, training_params=train_params)
+        model.train(model=net, training_params=train_params, train_loader=classification_test_dataloader(),
+                    valid_loader=classification_test_dataloader())
 
 
         calibrated_model_path = os.path.join(model.checkpoints_dir_path, "ckpt_calibrated_percentile_99.99.pth")
         calibrated_model_path = os.path.join(model.checkpoints_dir_path, "ckpt_calibrated_percentile_99.99.pth")
 
 
@@ -85,7 +85,8 @@ class QATIntegrationTest(unittest.TestCase):
             "percentile": 99.99
             "percentile": 99.99
         })
         })
 
 
-        model.train(model=net, training_params=train_params)
+        model.train(model=net, training_params=train_params, train_loader=classification_test_dataloader(),
+                    valid_loader=classification_test_dataloader())
 
 
 
 
 if __name__ == '__main__':
 if __name__ == '__main__':
Discard
Tip!

Press p or to see the previous file or, n or to see the next file