accelerated_features
accelerated_features copied to clipboard
OpenVINO support?
I just found OpenVINO does not support InstanceNorm https://docs.openvino.ai/2023.3/openvino_docs_ops_opset13.html
I think it's possible to include InstanceNorm in input preprocessing instead of in the model, or to use an equivalent replacement for InstanceNorm supported by OpenVINO.
Using the source code from https://github.com/acai66/accelerated_features, applying this patch may implicitly affect performance.
#dont backprop through normalization
with torch.no_grad():
x = x.mean(dim=1, keepdim = True)
if torch.onnx.is_in_onnx_export():
epsilon = 0.00001
mean = x.mean(dim=(2, 3), keepdim=True)
std = x.std(dim=(2, 3), unbiased=False, keepdim=True)
x = (x - mean) / (std + epsilon)
else:
x = self.norm(x)
#main backbone
x1 = self.block1(x)
Hello @wattanakorn495, as @acai66 mentioned, normalizing the input with standard normalization will have the same effect, thus it can be replaced as described by @acai66. It makes sense to use the same eps=1e-05 as used in the InstanceNorm2D layer.
Closing the issue. If you need further clarification, please feel free to reopen it!