How to create a mmap-able model from the output_graph.pb file

I can see from the readme file here: https://github.com/mozilla/DeepSpeech#making-a-mmap-able-model-for-inference

but i didnt understand this

TensorFlow has tooling to achieve this: it requires building the target //tensorflow/contrib/util:convert_graphdef_memmapped_format

where do i find this client to achieve this:

`convert_graphdef_memmapped_format --in_graph=output_graph.pb --out_graph=output_graph.pbmm`

i am not able to find this in the taskcluster as well. Not sure where to find this.

Please help in sharing the steps to complete this.

Thanks

https://index.taskcluster.net/v1/task/project.deepspeech.tensorflow.pip.master.cpu/artifacts/public/convert_graphdef_memmapped_format

2 Likes

Thanks @lissyx for the quick reply.
I tried this command out which is given on readme file of deep speech.

But I am getting command not found.

How do I run this ?? Please let me know where I am going wrong.

Thanks

I just gave you the file, download it ?

I downloaded it and then I tried to run that command but it says command not found error.

Try ./convert_graphdef_memmapped_format [...] ?! Like as usual when your binary is not in the PATH ?

Yes that was the issue. Thanks.
Also I can use this mmap model.dorectly like how I use the regular model right ?? Or do I need to pass any new flags to achieve this ??

Thanks

Just pass the different filename

Thanks alot for your help.

1 Like

Is that working properly now ? :slight_smile:

Hi @lissyx,

I did download the file you mentioned in this thread and it is in my current directory path. This is the command I am giving,

convert_graphdef_memmapped_format --in_graph=models/output_graph_trained_model_2.pb --out_graph=model/output_graph.pbmm

But I am getting,

convert_graphdef_memmapped_format: command not found

I also used,

./convert_graphdef_memmapped_format --in_graph=models/output_graph_trained_model_2.pb --out_graph=model/output_graph.pbmm

even here I am getting the same error.
where am I going wrong?

Thanks :slight_smile:

I really cannot help you for that, the error sugests that the binary is not here, but this is your system, I cannot do anything.

After download, you have to add executable permission for the file:
chmod +x convert_graphdef_memmapped_format

Then you can invoke the local command as:
./convert_graphdef_memmapped_format <your args>

3 Likes

How to use convert_graphdef_memmapped_format_lib.dms file in macOS ???

“convert_graphdef_memmapped_format.dms --in_graph=output_graph.pb --out_graph=output_graph.pbmm”

That’s the same as on any unix system, as explained above. I don’t know where you get convert_graphdef_memmapped_format_lib.dms from, it’s convert_graphdef_memmapped_format

(post withdrawn by author, will be automatically deleted in 24 hours unless flagged)

@inforahul92 Well, I’m sorry, but this link is valid, and produces convert_graphdef_memmapped_format as expected. Now, if you are on macOS, then it’s not the proper link, and using util/taskcluster.py as documented should produce you this link https://index.taskcluster.net/v1/task/project.deepspeech.tensorflow.pip.master.osx/artifacts/public/convert_graphdef_memmapped_format

It might be possible that you have to rename to .gz and then gunzip before use.

No luck with this hack :frowning:

“no luck” is not really helpful: you report “issues”, refer to a filename that makes no sense, but you share no error at all. I don’t use macOS, I can’t help you if you don’t give more context.