Better error handling in logging
from __future__ import absolute_import, print_function
import tensorflow as tf
+import warnings
from tensorflow.core.framework import summary_pb2
CONSOLE='NiftyNetCollectionConsole'
@@ -14,9 +15,10 @@ def add_to_collections(keys,value):
tf.add_to_collection(k,value)
def console_summary_string(byte_string):
+ try:
e=summary_pb2.Summary()
e.ParseFromString(byte_string)
- try:
return ', {}={:.8f}'.format(e.value[0].tag,e.value[0].simple_value)
except:
+ warnings.warn('Summary could not be converted to string so it will not print on the command line')
return ''
