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
ONNX模型优化时,使用PrepareOutput创建输入model的副本,并在优化后将Graph更新到model proto内,这两个接口在onnx内,都未将functions复制到结果模型上,onnxsim也未考虑优化model.functions的情况,同时也直接丢失了functions内的全部FunctionProto定义 此类情况,在使用torch.onnx.export开启export_modules_as_functions时出现,可以通过以下代码获得一个问题模型
import timm import torch import torch.nn as nn module = timm.create_model("vit_tiny_r_s16_p8_224") torch.onnx.export( module, (torch.ones([1, 3, 224, 224], dtype=torch.float32), ), "test.onnx", opset_version=15, export_modules_as_functions={ timm.models.vision_transformer_hybrid.HybridEmbed, nn.GELU } )
The text was updated successfully, but these errors were encountered:
No branches or pull requests
ONNX模型优化时,使用PrepareOutput创建输入model的副本,并在优化后将Graph更新到model proto内,这两个接口在onnx内,都未将functions复制到结果模型上,onnxsim也未考虑优化model.functions的情况,同时也直接丢失了functions内的全部FunctionProto定义
此类情况,在使用torch.onnx.export开启export_modules_as_functions时出现,可以通过以下代码获得一个问题模型
The text was updated successfully, but these errors were encountered: