From 685c1f7c1b211d42a3539a0e05c5b3895881473b Mon Sep 17 00:00:00 2001 From: juandspy <42124482+juandspy@users.noreply.github.com> Date: Wed, 22 Jan 2020 08:58:33 +0100 Subject: [PATCH 1/4] Update TRAINING.rst (mmap-able model) I had this "command not found" problem and solved it with https://discourse.mozilla.org/t/how-to-create-a-mmap-able-model-from-the-output-graph-pb-file/28984/13?, so I'm adding it to the documentation. --- doc/TRAINING.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/doc/TRAINING.rst b/doc/TRAINING.rst index ca0160e1..2f39a2b4 100644 --- a/doc/TRAINING.rst +++ b/doc/TRAINING.rst @@ -195,6 +195,13 @@ Producing a mmap-able model is as simple as: Upon sucessfull run, it should report about conversion of a non-zero number of nodes. If it reports converting ``0`` nodes, something is wrong: make sure your model is a frozen one, and that you have not applied any incompatible changes (this includes ``quantize_weights``\ ). +If this command returns ``convert_graphdef_memmapped_format: command not found`` it is probably because this binary is not in the ``PATH``. In order to solve this: + +.. code-block:: bash + + $ chmod +x convert_graphdef_memmapped_format + $ ./convert_graphdef_memmapped_format --in_graph=output_graph.pb --out_graph=output_graph.pbmm + Continuing training from a release model ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ From b6008d045493777afd68d9dc885cc56ffe04a4be Mon Sep 17 00:00:00 2001 From: juandspy <42124482+juandspy@users.noreply.github.com> Date: Wed, 22 Jan 2020 14:50:42 +0100 Subject: [PATCH 2/4] Update util/taskcluster.py --- util/taskcluster.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/util/taskcluster.py b/util/taskcluster.py index 20158c33..e4734ffa 100644 --- a/util/taskcluster.py +++ b/util/taskcluster.py @@ -146,6 +146,9 @@ def main(): maybe_download_tc(target_dir=args.target, tc_url=get_tc_url(args.arch, args.artifact, args.branch)) + if args.artifact == "convert_graphdef_memmapped_format": + subprocess.check_call(['chmod', '+x', os.path.join(args.target, args.artifact)]) + if '.tar.' in args.artifact: subprocess.check_call(['tar', 'xvf', os.path.join(args.target, args.artifact), '-C', args.target]) From 616760eb52e6e477b73805208c7614e67f76178a Mon Sep 17 00:00:00 2001 From: juandspy <42124482+juandspy@users.noreply.github.com> Date: Wed, 22 Jan 2020 16:15:26 +0100 Subject: [PATCH 3/4] Update TRAINING.rst --- doc/TRAINING.rst | 7 ------- 1 file changed, 7 deletions(-) diff --git a/doc/TRAINING.rst b/doc/TRAINING.rst index 2f39a2b4..ca0160e1 100644 --- a/doc/TRAINING.rst +++ b/doc/TRAINING.rst @@ -195,13 +195,6 @@ Producing a mmap-able model is as simple as: Upon sucessfull run, it should report about conversion of a non-zero number of nodes. If it reports converting ``0`` nodes, something is wrong: make sure your model is a frozen one, and that you have not applied any incompatible changes (this includes ``quantize_weights``\ ). -If this command returns ``convert_graphdef_memmapped_format: command not found`` it is probably because this binary is not in the ``PATH``. In order to solve this: - -.. code-block:: bash - - $ chmod +x convert_graphdef_memmapped_format - $ ./convert_graphdef_memmapped_format --in_graph=output_graph.pb --out_graph=output_graph.pbmm - Continuing training from a release model ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ From 29a92e098fcc8d71d1501727daa79ef85dfecb04 Mon Sep 17 00:00:00 2001 From: juandspy <42124482+juandspy@users.noreply.github.com> Date: Wed, 22 Jan 2020 16:22:15 +0100 Subject: [PATCH 4/4] Update taskcluster.py I copied ``maybe_download_tc_bin`` syntax in order to make the code easier to follow. --- util/taskcluster.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/util/taskcluster.py b/util/taskcluster.py index e4734ffa..39560227 100644 --- a/util/taskcluster.py +++ b/util/taskcluster.py @@ -147,7 +147,9 @@ def main(): maybe_download_tc(target_dir=args.target, tc_url=get_tc_url(args.arch, args.artifact, args.branch)) if args.artifact == "convert_graphdef_memmapped_format": - subprocess.check_call(['chmod', '+x', os.path.join(args.target, args.artifact)]) + convert_graph_file = os.path.join(args.target, args.artifact) + final_stat = os.stat(convert_graph_file) + os.chmod(convert_graph_file, final_stat.st_mode | stat.S_IEXEC) if '.tar.' in args.artifact: subprocess.check_call(['tar', 'xvf', os.path.join(args.target, args.artifact), '-C', args.target])