Add home folder lookup to resolve_checkpoint
@@ -16,6 +16,7 @@ import tensorflow as tf
from tensorflow.core.framework import summary_pb2
from niftynet.utilities.util_import import check_module
+from niftynet.utilities.niftynet_global_config import NiftyNetGlobalConfig
IS_PYTHON2 = False if sys.version_info[0] > 2 else True
@@ -435,6 +436,9 @@ def resolve_checkpoint(checkpoint_name):
# checkpoint_name.index is in the file system
# eventually will support checkpoint names that can be referenced
# in a paths file
+ home_folder = NiftyNetGlobalConfig().get_niftynet_home_folder()
+ checkpoint_name = to_absolute_path(input_path=checkpoint_name,
+ model_root=home_folder)
if os.path.isfile(checkpoint_name + '.index'):
return checkpoint_name
raise ValueError('Invalid checkpoint {}'.format(checkpoint_name))
