Skip to content

Commit 77e535b

Browse files
committed
better error messages for custom object import
1 parent 43646ae commit 77e535b

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

customObjects.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,25 @@
55
try:
66
imp.find_module('Losses')
77
from Losses import *
8-
except ImportError:
9-
print ('No Losses module found, ignoring at your own risk')
8+
except ImportError as e:
9+
print ('No Losses module found, ignoring at your own risk. The following error occured:')
10+
print(e)
1011
global_loss_list = {}
1112

1213
try:
1314
imp.find_module('Layers')
1415
from Layers import *
15-
except ImportError:
16-
print ('No Layers module found, ignoring at your own risk')
16+
except ImportError as e:
17+
print ('No Layers module found, ignoring at your own risk. The following error occured:')
18+
print(e)
1719
global_layers_list = {}
1820

1921
try:
2022
imp.find_module('Metrics')
2123
from Metrics import *
22-
except ImportError:
23-
print ('No metrics module found, ignoring at your own risk')
24+
except ImportError as e:
25+
print ('No metrics module found, ignoring at your own risk. The following error occured:')
26+
print(e)
2427
global_metrics_list = {}
2528

2629
def get_custom_objects():

0 commit comments

Comments
 (0)