MCPcopy Index your code
hub / github.com/tensorlayer/TensorLayer / check_ckpt_file

Function check_ckpt_file

tensorlayer/files/utils.py:2783–2798  ·  view source on GitHub ↗
(model_dir)

Source from the content-addressed store, hash-verified

2781
2782
2783def check_ckpt_file(model_dir):
2784 model_dir = model_dir
2785 model_path = None
2786 count_extension = 0
2787 for root, dirs, files in os.walk(model_dir):
2788 for file in files:
2789 filename, extension = os.path.splitext(file)
2790 if extension in ['.data-00000-of-00001', '.index', '.meta']:
2791 count_extension += 1
2792 if count_extension == 3:
2793 model_path = model_dir + '/' + filename
2794 else:
2795 raise Exception("Check the file extension for missing .data-00000-of-00001, .index, .meta")
2796 if model_path is None:
2797 raise Exception('The ckpt file is not found')
2798 return model_path, filename
2799
2800
2801def rename_weight_or_biases(variable_name):

Callers 2

load_and_assign_ckptFunction · 0.85
ckpt_to_npz_dictFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…