We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ascend
GPU
CPU
/device ascend
相同的 mindir 文件,mindspore_lite 和 mindspore 比较,mindspore 无法获取正确信息。
首先是 mindspore 框架读取 mindir 数据
import mindspore as ms from mindspore import nn graph = ms.load("output.mindir") net = nn.GraphCell(graph) print(net.get_inputs()) >>> None
其次是 mindspore_lite 读取 mindir 数据
import numpy as np import mindspore_lite as mslite context = mslite.Context() context.target = ["cpu"] context.cpu.thread_num = 1 context.cpu.thread_affinity_mode = 2 model = mslite.Model() model.build_from_file("output.mindir", mslite.ModelType.MINDIR, context) print(model.get_inputs()[0]) >>> name: x >>> ... >>> shape: [1, 3, 720, 1280]
相比之下,mindspore_lite 成功读取了输入的 shape,而 mindspore 读取为 None。从源码来看,似乎 mindspore.nn.Cell.get_inputs() 只有在 set_inputs() 之后才能读取,通过 net = nn.GraphCell(graph) 并不会读取 mindir 中的 input_shape 进行初始化 Cell 的 _dynamic_shape_inputs 属性。不知道这是设计本身就这样,还是一个 bug。
mindspore.nn.Cell.get_inputs()
set_inputs()
net = nn.GraphCell(graph)
_dynamic_shape_inputs
mindir 文件对应的地址为 https://github.com/mindspore-lab/mindocr/blob/main/configs/det/east/README_CN.md 中的 https://download.mindspore.cn/toolkits/mindocr/east/east_resnet50_ic15-7262e359-5f05cd42.mindir
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Environment
Hardware Environment(
Ascend
/GPU
/CPU
):Software Environment:
Describe the current behavior
相同的 mindir 文件,mindspore_lite 和 mindspore 比较,mindspore 无法获取正确信息。
Describe the expected behavior
首先是 mindspore 框架读取 mindir 数据
其次是 mindspore_lite 读取 mindir 数据
相比之下,mindspore_lite 成功读取了输入的 shape,而 mindspore 读取为 None。从源码来看,似乎
mindspore.nn.Cell.get_inputs()
只有在set_inputs()
之后才能读取,通过net = nn.GraphCell(graph)
并不会读取 mindir 中的 input_shape 进行初始化 Cell 的_dynamic_shape_inputs
属性。不知道这是设计本身就这样,还是一个 bug。Related log / screenshot
mindir 文件对应的地址为 https://github.com/mindspore-lab/mindocr/blob/main/configs/det/east/README_CN.md 中的 https://download.mindspore.cn/toolkits/mindocr/east/east_resnet50_ic15-7262e359-5f05cd42.mindir
Special notes for this issue
The text was updated successfully, but these errors were encountered: