24.02.1
|
Variables | |
list | strings_to_remove = ["read", "/:0"] |
dictionary | permutations = { 1 : [0], 2 : [1, 0], 3 : [2, 1, 0], 4 : [3, 2, 0, 1]} |
parser = argparse.ArgumentParser('Extract TensorFlow net parameters') | |
dest | |
type | |
str | |
required | |
True | |
help | |
False | |
default | |
action | |
storeRes | |
args = parser.parse_args() | |
graph_def = tf.GraphDef() | |
input_map | |
None | |
return_elements | |
name | |
op_dict | |
producer_op_list | |
varname = op_val.name | |
t = op_val.eval() | |
tT = t.transpose(permutations[len(t.shape)]) | |
Extract trainable parameters from a frozen model and stores them in numpy arrays. Usage: python tf_frozen_model_extractor -m path_to_frozem_model -d path_to_store_the_parameters Saves each variable to a {variable_name}.npy binary file. Note that the script permutes the trainable parameters to NCHW format. This is a pretty manual step thus it's not thoroughly tested.
action |
Definition at line 24 of file tf_frozen_model_extractor.py.
args = parser.parse_args() |
Definition at line 26 of file tf_frozen_model_extractor.py.
default |
Definition at line 23 of file tf_frozen_model_extractor.py.
dest |
Definition at line 22 of file tf_frozen_model_extractor.py.
False |
Definition at line 23 of file tf_frozen_model_extractor.py.
graph_def = tf.GraphDef() |
Definition at line 37 of file tf_frozen_model_extractor.py.
help |
Definition at line 22 of file tf_frozen_model_extractor.py.
input_map |
Definition at line 41 of file tf_frozen_model_extractor.py.
name |
Definition at line 41 of file tf_frozen_model_extractor.py.
None |
Definition at line 41 of file tf_frozen_model_extractor.py.
Referenced by GpuCkwActivation.write_component_code(), GpuCkwCast.write_component_code(), GpuCkwElementwiseBinary.write_component_code(), GpuCkwPool2d.write_component_code(), GpuCkwDepthwiseConv2d.write_component_code(), GpuCkwDirectConv2d.write_component_code(), and GpuCkwMatMul.write_component_code().
op_dict |
Definition at line 41 of file tf_frozen_model_extractor.py.
parser = argparse.ArgumentParser('Extract TensorFlow net parameters') |
Definition at line 21 of file tf_frozen_model_extractor.py.
dictionary permutations = { 1 : [0], 2 : [1, 0], 3 : [2, 1, 0], 4 : [3, 2, 0, 1]} |
Definition at line 17 of file tf_frozen_model_extractor.py.
producer_op_list |
Definition at line 41 of file tf_frozen_model_extractor.py.
required |
Definition at line 22 of file tf_frozen_model_extractor.py.
return_elements |
Definition at line 41 of file tf_frozen_model_extractor.py.
storeRes |
Definition at line 25 of file tf_frozen_model_extractor.py.
str |
Definition at line 22 of file tf_frozen_model_extractor.py.
list strings_to_remove = ["read", "/:0"] |
Definition at line 16 of file tf_frozen_model_extractor.py.
t = op_val.eval() |
Definition at line 49 of file tf_frozen_model_extractor.py.
Referenced by GpuKernelComponentGroup.add_component(), MLGOHeuristics.add_heuristic_tree(), GpuKernelComponentGraph.add_new_component(), bilinear_interpolate_with_border(), arm_compute::test::validation::reference.concatenate_layer(), ClConcatenate.configure(), NEUnstack.configure(), CLUnstack.configure(), CLDepthwiseConvolutionLayer.configure(), StackLayerNode.configure_output(), ConcatenateLayerNode.configure_output(), GpuDepthwiseConv2d.create_op(), arm_compute::test::validation::reference.depthconcatenate_layer(), InputNode.forward_descriptors(), ConstNode.forward_descriptors(), MLGOHeuristics.get_heuristic_tree(), ClTemplateWriter.get_tensors(), arm_compute::mlgo::parser.heuristic_tree(), arm_compute::mlgo::parser.heuristics_table_entry(), Scheduler.is_available(), GroupedConvolutionMutator.mutate(), arm_compute::test::validation::reference.safe_read(), OMPScheduler.schedule_op(), Scheduler.set(), arm_compute::test.set_tensor_dynamic(), arm_compute::test.set_tensor_static(), arm_compute::utils.string_from_scheduler_type(), TokenStream.take(), arm_compute::test::validation.TEST_CASE(), Token.Token(), GpuOperatorGroup.try_add_operator(), ClMatMul.validate(), and CLDepthwiseConvolutionLayer.validate().
True |
Definition at line 22 of file tf_frozen_model_extractor.py.
tT = t.transpose(permutations[len(t.shape)]) |
Definition at line 50 of file tf_frozen_model_extractor.py.
type |
Definition at line 22 of file tf_frozen_model_extractor.py.
varname = op_val.name |
Definition at line 45 of file tf_frozen_model_extractor.py.