Unverified Commit 76454b08 authored by regisss's avatar regisss Committed by GitHub
Browse files

Rename second input dimension from "sequence" to "num_channels" for CV models (#17976)

parent 780253ce
......@@ -194,7 +194,7 @@ class BeitOnnxConfig(OnnxConfig):
def inputs(self) -> Mapping[str, Mapping[int, str]]:
return OrderedDict(
[
("pixel_values", {0: "batch", 1: "sequence"}),
("pixel_values", {0: "batch", 1: "num_channels"}),
]
)
......
......@@ -117,7 +117,7 @@ class ConvNextOnnxConfig(OnnxConfig):
def inputs(self) -> Mapping[str, Mapping[int, str]]:
return OrderedDict(
[
("pixel_values", {0: "batch", 1: "sequence"}),
("pixel_values", {0: "batch", 1: "num_channels"}),
]
)
......
......@@ -193,7 +193,7 @@ class Data2VecVisionOnnxConfig(OnnxConfig):
def inputs(self) -> Mapping[str, Mapping[int, str]]:
return OrderedDict(
[
("pixel_values", {0: "batch", 1: "sequence"}),
("pixel_values", {0: "batch", 1: "num_channels"}),
]
)
......
......@@ -137,7 +137,7 @@ class DeiTOnnxConfig(OnnxConfig):
def inputs(self) -> Mapping[str, Mapping[int, str]]:
return OrderedDict(
[
("pixel_values", {0: "batch", 1: "sequence"}),
("pixel_values", {0: "batch", 1: "num_channels"}),
]
)
......
......@@ -220,8 +220,8 @@ class DetrOnnxConfig(OnnxConfig):
def inputs(self) -> Mapping[str, Mapping[int, str]]:
return OrderedDict(
[
("pixel_values", {0: "batch", 1: "sequence"}),
("pixel_mask", {0: "batch", 1: "sequence"}),
("pixel_values", {0: "batch", 1: "num_channels"}),
("pixel_mask", {0: "batch"}),
]
)
......
......@@ -212,7 +212,7 @@ class LayoutLMv3OnnxConfig(OnnxConfig):
("input_ids", {0: "batch", 1: "sequence"}),
("bbox", {0: "batch", 1: "sequence"}),
("attention_mask", {0: "batch", 1: "sequence"}),
("pixel_values", {0: "batch", 1: "sequence"}),
("pixel_values", {0: "batch", 1: "num_channels"}),
]
)
......
......@@ -171,7 +171,7 @@ class MobileViTOnnxConfig(OnnxConfig):
@property
def inputs(self) -> Mapping[str, Mapping[int, str]]:
return OrderedDict([("pixel_values", {0: "batch"})])
return OrderedDict([("pixel_values", {0: "batch", 1: "num_channels"})])
@property
def outputs(self) -> Mapping[str, Mapping[int, str]]:
......
......@@ -105,7 +105,7 @@ class ResNetOnnxConfig(OnnxConfig):
def inputs(self) -> Mapping[str, Mapping[int, str]]:
return OrderedDict(
[
("pixel_values", {0: "batch", 1: "sequence"}),
("pixel_values", {0: "batch", 1: "num_channels"}),
]
)
......
......@@ -135,7 +135,7 @@ class ViTOnnxConfig(OnnxConfig):
def inputs(self) -> Mapping[str, Mapping[int, str]]:
return OrderedDict(
[
("pixel_values", {0: "batch", 1: "sequence"}),
("pixel_values", {0: "batch", 1: "num_channels"}),
]
)
......
......@@ -199,6 +199,7 @@ PYTORCH_EXPORT_MODELS = {
("roformer", "junnyu/roformer_chinese_base"),
("squeezebert", "squeezebert/squeezebert-uncased"),
("mobilebert", "google/mobilebert-uncased"),
("mobilevit", "apple/mobilevit-small"),
("xlm", "xlm-clm-ende-1024"),
("xlm-roberta", "xlm-roberta-base"),
("layoutlm", "microsoft/layoutlm-base-uncased"),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment