zhy520xp / mace-makefile-project

makefile 交叉编译 libmace.a,并能在嵌入式端调用GPU来跑深度学习模型
96 stars 18 forks source link

模型转换问题。 #7

Open huishaoli opened 6 years ago

huishaoli commented 6 years ago

您好,非常感谢!您贴出来的 模型转换网址过期了。官方给的转换方法 正能在 把模型转换成android平台下的,我想在arm-linux平台下测试模型,该怎么转换呢?

Howave commented 6 years ago

同问, GPU的模型要怎么转? 试了自己的模型, 设置.yml文件里面 runtime: gpu 转出来的模型大小比cpu的小一半, 但是运行的时候出错: ../mace/core/tensor.h:246 check failed:is_bufferowener Aborted(core dumped)

Howave commented 6 years ago

试了一下需要对应的0.8.1版本的转换工具来转模型

zhy520xp commented 6 years ago

转出的模型比cpu小是因为gpu端做了量化的。

tinalazy commented 5 years ago

试了一下需要对应的0.8.1版本的转换工具来转模型

你好有QQ吗我模型转完了不知道为啥cpp编译出来的文件总是提示有问题

vincent-tx commented 5 years ago

你好,请问到底应该怎么转换自己的tensorflow模型为MACE模型啊?我的目标平台是3559A。我参考的是 https://mace.readthedocs.io/v0.8.1/getting_started/how_to_build.html 我看文档上说,要使用 tools/converter.py build --config=models/config.yaml 运行时,报错说 sh.CommandNotFound: adb, 要执行sh.adb("devices") adb 不是Android Debug Bridge吗?是调试Android设备的啊. sh.adb("devices")应该是要获取当前连接的模拟器或设备。 又看到文档上说: currently only android devices supported. 所以,难道说一定要有一个安卓设备才能做模型转换,而且只能转换为安卓平台模型? 请问大神应该怎么处理啊?又或者我的转换方法完全不对?

vincent-tx commented 5 years ago

试了一下需要对应的0.8.1版本的转换工具来转模型

请问具体怎么操作啊?我的目标平台是hi3559A

zhy520xp commented 5 years ago

编译unit_test的文件,然后运行啊。我这个只是用mobilenetv2举例,其他模型要参考这个例子做相应的修改

------------------ 原始邮件 ------------------ 发件人: "vincent-tx"<notifications@github.com>; 发送时间: 2019年9月9日(星期一) 下午4:50 收件人: "zhy520xp/mace-makefile-project"<mace-makefile-project@noreply.github.com>; 抄送: "谢鹏 hitee2011"<958499851@qq.com>;"Comment"<comment@noreply.github.com>; 主题: Re: [zhy520xp/mace-makefile-project] 模型转换问题。 (#7)

试了一下需要对应的0.8.1版本的转换工具来转模型

请问具体怎么操作啊?我的目标平台是hi3559A

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

vincent-tx commented 5 years ago

编译unit_test的文件,然后运行啊。我这个只是用mobilenetv2举例,其他模型要参考这个例子做相应的修改 ------------------ 原始邮件 ------------------ 发件人: "vincent-tx"<notifications@github.com>; 发送时间: 2019年9月9日(星期一) 下午4:50 收件人: "zhy520xp/mace-makefile-project"<mace-makefile-project@noreply.github.com>; 抄送: "谢鹏 hitee2011"<958499851@qq.com>;"Comment"<comment@noreply.github.com>; 主题: Re: [zhy520xp/mace-makefile-project] 模型转换问题。 (#7) 试了一下需要对应的0.8.1版本的转换工具来转模型 请问具体怎么操作啊?我的目标平台是hi3559A — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

例子中的unit_test已经跑通了。现在的问题是我其他的模型怎么转换为MACE格式模型?我现在用tensorflow生成了pb模型文件。参考的是 https://mace.readthedocs.io/v0.8.1/getting_started/how_to_build.html 没有转成功。

zhy520xp commented 5 years ago

你转的也是mobilenetv2网络吗?

------------------ 原始邮件 ------------------ 发件人: "vincent-tx"<notifications@github.com>; 发送时间: 2019年9月9日(星期一) 下午5:06 收件人: "zhy520xp/mace-makefile-project"<mace-makefile-project@noreply.github.com>; 抄送: "谢鹏 hitee2011"<958499851@qq.com>;"Comment"<comment@noreply.github.com>; 主题: Re: [zhy520xp/mace-makefile-project] 模型转换问题。 (#7)

编译unit_test的文件,然后运行啊。我这个只是用mobilenetv2举例,其他模型要参考这个例子做相应的修改 … ------------------ 原始邮件 ------------------ 发件人: "vincent-tx"<notifications@github.com>; 发送时间: 2019年9月9日(星期一) 下午4:50 收件人: "zhy520xp/mace-makefile-project"<mace-makefile-project@noreply.github.com>; 抄送: "谢鹏 hitee2011"<958499851@qq.com>;"Comment"<comment@noreply.github.com>; 主题: Re: [zhy520xp/mace-makefile-project] 模型转换问题。 (#7) 试了一下需要对应的0.8.1版本的转换工具来转模型 请问具体怎么操作啊?我的目标平台是hi3559A — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

例子中的unit_test已经跑通了。现在的问题是我其他的模型怎么转换为MACE格式模型?我现在用tensorflow生成了pb模型文件。参考的是 https://mace.readthedocs.io/v0.8.1/getting_started/how_to_build.html没有转成功

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

vincent-tx commented 5 years ago

你转的也是mobilenetv2网络吗? ------------------ 原始邮件 ------------------ 发件人: "vincent-tx"<notifications@github.com>; 发送时间: 2019年9月9日(星期一) 下午5:06 收件人: "zhy520xp/mace-makefile-project"<mace-makefile-project@noreply.github.com>; 抄送: "谢鹏 hitee2011"<958499851@qq.com>;"Comment"<comment@noreply.github.com>; 主题: Re: [zhy520xp/mace-makefile-project] 模型转换问题。 (#7) 编译unit_test的文件,然后运行啊。我这个只是用mobilenetv2举例,其他模型要参考这个例子做相应的修改 … ------------------ 原始邮件 ------------------ 发件人: "vincent-tx"<notifications@github.com>; 发送时间: 2019年9月9日(星期一) 下午4:50 收件人: "zhy520xp/mace-makefile-project"<mace-makefile-project@noreply.github.com>; 抄送: "谢鹏 hitee2011"<958499851@qq.com>;"Comment"<comment@noreply.github.com>; 主题: Re: [zhy520xp/mace-makefile-project] 模型转换问题。 (#7) 试了一下需要对应的0.8.1版本的转换工具来转模型 请问具体怎么操作啊?我的目标平台是hi3559A — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread. 例子中的unit_test已经跑通了。现在的问题是我其他的模型怎么转换为MACE格式模型?我现在用tensorflow生成了pb模型文件。参考的是 https://mace.readthedocs.io/v0.8.1/getting_started/how_to_build.html没有转成功。 — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

不是。是我自己写的模型

zhy520xp commented 5 years ago

你自己写的模型没转成功,你得先搞清楚你的模型mace是否支持。是否有mace不支持的特殊层。你得去mace社区问问怎样转自己得模型吧

------------------ 原始邮件 ------------------ 发件人: "vincent-tx"<notifications@github.com>; 发送时间: 2019年9月9日(星期一) 下午5:20 收件人: "zhy520xp/mace-makefile-project"<mace-makefile-project@noreply.github.com>; 抄送: "谢鹏 hitee2011"<958499851@qq.com>;"Comment"<comment@noreply.github.com>; 主题: Re: [zhy520xp/mace-makefile-project] 模型转换问题。 (#7)

你转的也是mobilenetv2网络吗? … ------------------ 原始邮件 ------------------ 发件人: "vincent-tx"<notifications@github.com>; 发送时间: 2019年9月9日(星期一) 下午5:06 收件人: "zhy520xp/mace-makefile-project"<mace-makefile-project@noreply.github.com>; 抄送: "谢鹏 hitee2011"<958499851@qq.com>;"Comment"<comment@noreply.github.com>; 主题: Re: [zhy520xp/mace-makefile-project] 模型转换问题。 (#7) 编译unit_test的文件,然后运行啊。我这个只是用mobilenetv2举例,其他模型要参考这个例子做相应的修改 … ------------------ 原始邮件 ------------------ 发件人: "vincent-tx"<notifications@github.com>; 发送时间: 2019年9月9日(星期一) 下午4:50 收件人: "zhy520xp/mace-makefile-project"<mace-makefile-project@noreply.github.com>; 抄送: "谢鹏 hitee2011"<958499851@qq.com>;"Comment"<comment@noreply.github.com>; 主题: Re: [zhy520xp/mace-makefile-project] 模型转换问题。 (#7) 试了一下需要对应的0.8.1版本的转换工具来转模型 请问具体怎么操作啊?我的目标平台是hi3559A — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread. 例子中的unit_test已经跑通了。现在的问题是我其他的模型怎么转换为MACE格式模型?我现在用tensorflow生成了pb模型文件。参考的是 https://mace.readthedocs.io/v0.8.1/getting_started/how_to_build.html没有转成功。 — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

不是。是我自己写的模型

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

vincent-tx commented 5 years ago

你转的也是mobilenetv2网络吗? ------------------ 原始邮件 ------------------ 发件人: "vincent-tx"[notifications@github.com](mailto:notifications@github.com); 发送时间: 2019年9月9日(星期一) 下午5:06 收件人: "zhy520xp/mace-makefile-project"[mace-makefile-project@noreply.github.com](mailto:mace-makefile-project@noreply.github.com); 抄送: "谢鹏 hitee2011"[958499851@qq.com](mailto:958499851@qq.com);"Comment"[comment@noreply.github.com](mailto:comment@noreply.github.com); 主题: Re: [zhy520xp/mace-makefile-project] 模型转换问题。 (#7) 编译unit_test的文件,然后运行啊。我这个只是用mobilenetv2举例,其他模型要参考这个例子做相应的修改 … ------------------ 原始邮件 ------------------ 发件人: "vincent-tx"[notifications@github.com](mailto:notifications@github.com); 发送时间: 2019年9月9日(星期一) 下午4:50 收件人: "zhy520xp/mace-makefile-project"[mace-makefile-project@noreply.github.com](mailto:mace-makefile-project@noreply.github.com); 抄送: "谢鹏 hitee2011"[958499851@qq.com](mailto:958499851@qq.com);"Comment"[comment@noreply.github.com](mailto:comment@noreply.github.com); 主题: Re: [zhy520xp/mace-makefile-project] 模型转换问题。 (#7) 试了一下需要对应的0.8.1版本的转换工具来转模型 请问具体怎么操作啊?我的目标平台是hi3559A — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread. 例子中的unit_test已经跑通了。现在的问题是我其他的模型怎么转换为MACE格式模型?我现在用tensorflow生成了pb模型文件。参考的是 https://mace.readthedocs.io/v0.8.1/getting_started/how_to_build.html没有转成功。 — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

不是。是我自己写的模型

试了一下,转mobilenetv2网络也是一样的问题。

zhy520xp commented 5 years ago

那这种情况很可能是版本的问题,这个工程是mace刚发布时候建立的,后来mace更新,工程并未跟着更新。https://github.com/conansherry/convert_model,试试这个转换工具

------------------ 原始邮件 ------------------ 发件人: "vincent-tx"<notifications@github.com>; 发送时间: 2019年9月9日(星期一) 下午5:23 收件人: "zhy520xp/mace-makefile-project"<mace-makefile-project@noreply.github.com>; 抄送: "谢鹏 hitee2011"<958499851@qq.com>;"Comment"<comment@noreply.github.com>; 主题: Re: [zhy520xp/mace-makefile-project] 模型转换问题。 (#7)

你转的也是mobilenetv2网络吗? … ------------------ 原始邮件 ------------------ 发件人: "vincent-tx"<notifications@github.com>; 发送时间: 2019年9月9日(星期一) 下午5:06 收件人: "zhy520xp/mace-makefile-project"<mace-makefile-project@noreply.github.com>; 抄送: "谢鹏 hitee2011"<958499851@qq.com>;"Comment"<comment@noreply.github.com>; 主题: Re: [zhy520xp/mace-makefile-project] 模型转换问题。 (#7) 编译unit_test的文件,然后运行啊。我这个只是用mobilenetv2举例,其他模型要参考这个例子做相应的修改 … ------------------ 原始邮件 ------------------ 发件人: "vincent-tx"<notifications@github.com>; 发送时间: 2019年9月9日(星期一) 下午4:50 收件人: "zhy520xp/mace-makefile-project"<mace-makefile-project@noreply.github.com>; 抄送: "谢鹏 hitee2011"<958499851@qq.com>;"Comment"<comment@noreply.github.com>; 主题: Re: [zhy520xp/mace-makefile-project] 模型转换问题。 (#7) 试了一下需要对应的0.8.1版本的转换工具来转模型 请问具体怎么操作啊?我的目标平台是hi3559A — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread. 例子中的unit_test已经跑通了。现在的问题是我其他的模型怎么转换为MACE格式模型?我现在用tensorflow生成了pb模型文件。参考的是 https://mace.readthedocs.io/v0.8.1/getting_started/how_to_build.html没有转成功。 — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

不是。是我自己写的模型

试了一下,转mobilenetv2网络也是一样的问题。

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

vincent-tx commented 5 years ago

那这种情况很可能是版本的问题,这个工程是mace刚发布时候建立的,后来mace更新,工程并未跟着更新。https://github.com/conansherry/convert_model,试试这个转换工具。 ------------------ 原始邮件 ------------------ 发件人: "vincent-tx"<notifications@github.com>; 发送时间: 2019年9月9日(星期一) 下午5:23 收件人: "zhy520xp/mace-makefile-project"<mace-makefile-project@noreply.github.com>; 抄送: "谢鹏 hitee2011"<958499851@qq.com>;"Comment"<comment@noreply.github.com>; 主题: Re: [zhy520xp/mace-makefile-project] 模型转换问题。 (#7) 你转的也是mobilenetv2网络吗? … ------------------ 原始邮件 ------------------ 发件人: "vincent-tx"<notifications@github.com>; 发送时间: 2019年9月9日(星期一) 下午5:06 收件人: "zhy520xp/mace-makefile-project"<mace-makefile-project@noreply.github.com>; 抄送: "谢鹏 hitee2011"<958499851@qq.com>;"Comment"<comment@noreply.github.com>; 主题: Re: [zhy520xp/mace-makefile-project] 模型转换问题。 (#7) 编译unit_test的文件,然后运行啊。我这个只是用mobilenetv2举例,其他模型要参考这个例子做相应的修改 … ------------------ 原始邮件 ------------------ 发件人: "vincent-tx"<notifications@github.com>; 发送时间: 2019年9月9日(星期一) 下午4:50 收件人: "zhy520xp/mace-makefile-project"<mace-makefile-project@noreply.github.com>; 抄送: "谢鹏 hitee2011"<958499851@qq.com>;"Comment"<comment@noreply.github.com>; 主题: Re: [zhy520xp/mace-makefile-project] 模型转换问题。 (#7) 试了一下需要对应的0.8.1版本的转换工具来转模型 请问具体怎么操作啊?我的目标平台是hi3559A — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread. 例子中的unit_test已经跑通了。现在的问题是我其他的模型怎么转换为MACE格式模型?我现在用tensorflow生成了pb模型文件。参考的是 https://mace.readthedocs.io/v0.8.1/getting_started/how_to_build.html没有转成功。 — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread. 不是。是我自己写的模型 试了一下,转mobilenetv2网络也是一样的问题。 — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

谢谢。用 https://github.com/conansherry/convert_model 这个工具可以转,不过只支持caffe,只支持Python2。也有局限性。