Skip to content

Commit

Permalink
easyvolcap: update exception
Browse files Browse the repository at this point in the history
  • Loading branch information
dendenxu committed Apr 6, 2024
1 parent 9b4806b commit e5507e1
Show file tree
Hide file tree
Showing 13 changed files with 88 additions and 49 deletions.
11 changes: 7 additions & 4 deletions easyvolcap/dataloaders/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@
try:
# from . import * # the actual imports
exec(f'from . import {module}')
except ModuleNotFoundError as e:
from easyvolcap.utils.console_utils import *
log(yellow(f'Failed to import {red(module)}{red(".py")}, missing package: {red(e.name)}'))
except Exception as e:
import sys
from easyvolcap.utils.console_utils import *
stacktrace() # print a full stacktrace for the users convenience

exception_type, exception_object, exception_traceback = sys.exc_info()
filename = exception_traceback.tb_frame.f_code.co_filename
line_number = exception_traceback.tb_lineno

log(yellow(f'Failed to import {red(filename)}:{line_number}, {red(type(e))}: {red_slim(e)}}'))
11 changes: 7 additions & 4 deletions easyvolcap/dataloaders/datasets/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@
try:
# from . import * # the actual imports
exec(f'from . import {module}')
except ModuleNotFoundError as e:
from easyvolcap.utils.console_utils import *
log(yellow(f'Failed to import {red(module)}{red(".py")}, missing package: {red(e.name)}'))
except Exception as e:
import sys
from easyvolcap.utils.console_utils import *
stacktrace() # print a full stacktrace for the users convenience

exception_type, exception_object, exception_traceback = sys.exc_info()
filename = exception_traceback.tb_frame.f_code.co_filename
line_number = exception_traceback.tb_lineno

log(yellow(f'Failed to import {red(filename)}:{line_number}, {red(type(e))}: {red_slim(e)}}'))
11 changes: 7 additions & 4 deletions easyvolcap/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@
try:
# from . import * # the actual imports
exec(f'from . import {module}')
except ModuleNotFoundError as e:
from easyvolcap.utils.console_utils import *
log(yellow(f'Failed to import {red(module)}{red(".py")}, missing package: {red(e.name)}'))
except Exception as e:
import sys
from easyvolcap.utils.console_utils import *
stacktrace() # print a full stacktrace for the users convenience

exception_type, exception_object, exception_traceback = sys.exc_info()
filename = exception_traceback.tb_frame.f_code.co_filename
line_number = exception_traceback.tb_lineno

log(yellow(f'Failed to import {red(filename)}:{line_number}, {red(type(e))}: {red_slim(e)}}'))
11 changes: 7 additions & 4 deletions easyvolcap/models/cameras/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@
try:
# from . import * # the actual imports
exec(f'from . import {module}')
except ModuleNotFoundError as e:
from easyvolcap.utils.console_utils import *
log(yellow(f'Failed to import {red(module)}{red(".py")}, missing package: {red(e.name)}'))
except Exception as e:
import sys
from easyvolcap.utils.console_utils import *
stacktrace() # print a full stacktrace for the users convenience

exception_type, exception_object, exception_traceback = sys.exc_info()
filename = exception_traceback.tb_frame.f_code.co_filename
line_number = exception_traceback.tb_lineno

log(yellow(f'Failed to import {red(filename)}:{line_number}, {red(type(e))}: {red_slim(e)}}'))
11 changes: 7 additions & 4 deletions easyvolcap/models/networks/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@
try:
# from . import * # the actual imports
exec(f'from . import {module}')
except ModuleNotFoundError as e:
from easyvolcap.utils.console_utils import *
log(yellow(f'Failed to import {red(module)}{red(".py")}, missing package: {red(e.name)}'))
except Exception as e:
import sys
from easyvolcap.utils.console_utils import *
stacktrace() # print a full stacktrace for the users convenience

exception_type, exception_object, exception_traceback = sys.exc_info()
filename = exception_traceback.tb_frame.f_code.co_filename
line_number = exception_traceback.tb_lineno

log(yellow(f'Failed to import {red(filename)}:{line_number}, {red(type(e))}: {red_slim(e)}}'))
11 changes: 7 additions & 4 deletions easyvolcap/models/networks/embedders/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@
try:
# from . import * # the actual imports
exec(f'from . import {module}')
except ModuleNotFoundError as e:
from easyvolcap.utils.console_utils import *
log(yellow(f'Failed to import {red(module)}{red(".py")}, missing package: {red(e.name)}'))
except Exception as e:
import sys
from easyvolcap.utils.console_utils import *
stacktrace() # print a full stacktrace for the users convenience

exception_type, exception_object, exception_traceback = sys.exc_info()
filename = exception_traceback.tb_frame.f_code.co_filename
line_number = exception_traceback.tb_lineno

log(yellow(f'Failed to import {red(filename)}:{line_number}, {red(type(e))}: {red_slim(e)}}'))
11 changes: 7 additions & 4 deletions easyvolcap/models/renderers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@
try:
# from . import * # the actual imports
exec(f'from . import {module}')
except ModuleNotFoundError as e:
from easyvolcap.utils.console_utils import *
log(yellow(f'Failed to import {red(module)}{red(".py")}, missing package: {red(e.name)}'))
except Exception as e:
import sys
from easyvolcap.utils.console_utils import *
stacktrace() # print a full stacktrace for the users convenience

exception_type, exception_object, exception_traceback = sys.exc_info()
filename = exception_traceback.tb_frame.f_code.co_filename
line_number = exception_traceback.tb_lineno

log(yellow(f'Failed to import {red(filename)}:{line_number}, {red(type(e))}: {red_slim(e)}}'))
11 changes: 7 additions & 4 deletions easyvolcap/models/samplers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@
try:
# from . import * # the actual imports
exec(f'from . import {module}')
except ModuleNotFoundError as e:
from easyvolcap.utils.console_utils import *
log(yellow(f'Failed to import {red(module)}{red(".py")}, missing package: {red(e.name)}'))
except Exception as e:
import sys
from easyvolcap.utils.console_utils import *
stacktrace() # print a full stacktrace for the users convenience

exception_type, exception_object, exception_traceback = sys.exc_info()
filename = exception_traceback.tb_frame.f_code.co_filename
line_number = exception_traceback.tb_lineno

log(yellow(f'Failed to import {red(filename)}:{line_number}, {red(type(e))}: {red_slim(e)}}'))
11 changes: 7 additions & 4 deletions easyvolcap/models/supervisors/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@
try:
# from . import * # the actual imports
exec(f'from . import {module}')
except ModuleNotFoundError as e:
from easyvolcap.utils.console_utils import *
log(yellow(f'Failed to import {red(module)}{red(".py")}, missing package: {red(e.name)}'))
except Exception as e:
import sys
from easyvolcap.utils.console_utils import *
stacktrace() # print a full stacktrace for the users convenience

exception_type, exception_object, exception_traceback = sys.exc_info()
filename = exception_traceback.tb_frame.f_code.co_filename
line_number = exception_traceback.tb_lineno

log(yellow(f'Failed to import {red(filename)}:{line_number}, {red(type(e))}: {red_slim(e)}}'))
11 changes: 7 additions & 4 deletions easyvolcap/runners/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@
try:
# from . import * # the actual imports
exec(f'from . import {module}')
except ModuleNotFoundError as e:
from easyvolcap.utils.console_utils import *
log(yellow(f'Failed to import {red(module)}{red(".py")}, missing package: {red(e.name)}'))
except Exception as e:
import sys
from easyvolcap.utils.console_utils import *
stacktrace() # print a full stacktrace for the users convenience

exception_type, exception_object, exception_traceback = sys.exc_info()
filename = exception_traceback.tb_frame.f_code.co_filename
line_number = exception_traceback.tb_lineno

log(yellow(f'Failed to import {red(filename)}:{line_number}, {red(type(e))}: {red_slim(e)}}'))
11 changes: 7 additions & 4 deletions easyvolcap/runners/evaluators/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@
try:
# from . import * # the actual imports
exec(f'from . import {module}')
except ModuleNotFoundError as e:
from easyvolcap.utils.console_utils import *
log(yellow(f'Failed to import {red(module)}{red(".py")}, missing package: {red(e.name)}'))
except Exception as e:
import sys
from easyvolcap.utils.console_utils import *
stacktrace() # print a full stacktrace for the users convenience

exception_type, exception_object, exception_traceback = sys.exc_info()
filename = exception_traceback.tb_frame.f_code.co_filename
line_number = exception_traceback.tb_lineno

log(yellow(f'Failed to import {red(filename)}:{line_number}, {red(type(e))}: {red_slim(e)}}'))
11 changes: 7 additions & 4 deletions easyvolcap/runners/visualizers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@
try:
# from . import * # the actual imports
exec(f'from . import {module}')
except ModuleNotFoundError as e:
from easyvolcap.utils.console_utils import *
log(yellow(f'Failed to import {red(module)}{red(".py")}, missing package: {red(e.name)}'))
except Exception as e:
import sys
from easyvolcap.utils.console_utils import *
stacktrace() # print a full stacktrace for the users convenience

exception_type, exception_object, exception_traceback = sys.exc_info()
filename = exception_traceback.tb_frame.f_code.co_filename
line_number = exception_traceback.tb_lineno

log(yellow(f'Failed to import {red(filename)}:{line_number}, {red(type(e))}: {red_slim(e)}}'))
5 changes: 4 additions & 1 deletion easyvolcap/runners/volumetric_video_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,10 @@ def __init__(self,
self.test_using_inference_mode = test_using_inference_mode

# Setting VRAM limit on Windows might make the framerate more stable
torch.cuda.set_per_process_memory_fraction(torch_vram_frac_limit) # set vram usage limit to current device
try:
torch.cuda.set_per_process_memory_fraction(torch_vram_frac_limit) # set vram usage limit to current device
except:
pass

# HACK: GLOBAL VARIABLE, when dumping config, should ignore this one
cfg.runner = self
Expand Down

0 comments on commit e5507e1

Please sign in to comment.