Skip to content

Commit

Permalink
Debug
Browse files Browse the repository at this point in the history
  • Loading branch information
ad-daniel committed Dec 26, 2022
1 parent 11d746a commit 7f221d7
Showing 1 changed file with 38 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import shutil
import os
import torch
import traceback
from opendr.engine.datasets import PointCloudsDatasetIterator
from opendr.perception.object_detection_3d import VoxelObjectDetection3DLearner
from opendr.perception.object_detection_3d import KittiDataset, LabeledPointCloudsDatasetIterator
Expand Down Expand Up @@ -71,8 +72,15 @@ def setUpClass(cls):

@classmethod
def tearDownClass(cls):
# Clean up downloaded files
rmdir(os.path.join(cls.temp_dir))
try:
del cls
# Clean up downloaded files
rmdir(os.path.join(cls.temp_dir))
except Exception:
print("Exception in user code:")
print("-" * 60)
traceback.print_exc(file=sys.stdout)
print("-" * 60)

def test_fit(self):
def test_model(name, config):
Expand All @@ -98,7 +106,13 @@ def test_model(name, config):
print("Fit", name, "ok", file=sys.stderr)

for name, config in self.car_configs.items():
test_model(name, config)
try:
test_model(name, config)
except Exception:
print("Exception in user code:")
print("-" * 60)
traceback.print_exc(file=sys.stdout)
print("-" * 60)

def test_fit_iterator(self):
def test_model(name, config):
Expand Down Expand Up @@ -134,7 +148,13 @@ def test_model(name, config):
print("Fit iterator", name, "ok", file=sys.stderr)

for name, config in self.car_configs.items():
test_model(name, config)
try:
test_model(name, config)
except Exception:
print("Exception in user code:")
print("-" * 60)
traceback.print_exc(file=sys.stdout)
print("-" * 60)

def test_save(self):
def test_model(name, config):
Expand All @@ -161,7 +181,13 @@ def test_model(name, config):
print("Save", name, "ok", file=sys.stderr)

for name, config in self.car_configs.items():
test_model(name, config)
try:
test_model(name, config)
except Exception:
print("Exception in user code:")
print("-" * 60)
traceback.print_exc(file=sys.stdout)
print("-" * 60)

def test_optimize(self):
def test_model(name, config):
Expand Down Expand Up @@ -193,7 +219,13 @@ def test_model(name, config):
print("Optimize", name, "ok", file=sys.stderr)

for name, config in self.car_configs.items():
test_model(name, config)
try:
test_model(name, config)
except Exception:
print("Exception in user code:")
print("-" * 60)
traceback.print_exc(file=sys.stdout)
print("-" * 60)


if __name__ == "__main__":
Expand Down

0 comments on commit 7f221d7

Please sign in to comment.