Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

Clip operation is not supported #92

Closed
alxmamaev opened this issue Feb 17, 2019 · 1 comment
Closed

Clip operation is not supported #92

alxmamaev opened this issue Feb 17, 2019 · 1 comment
Labels
enhancement New feature or request operator Related to one or more ONNX operators

Comments

@alxmamaev
Copy link

If you trying to export and load MobilenetV2 (like in this implementation)
You will get error: unrecognized operator 'Clip'
This error is except because in MobilenetV2 are using ReLU6 instead ReLU.

@NTT123
Copy link
Contributor

NTT123 commented Feb 17, 2019

Instead of waiting for clip operation being supported, you can replace ReLU6 module by the following custom module

class MyReLU6(nn.Module):
    def __init__(self):
        super().__init__()
    def forward(self, x):
        return  6 - nn.functional.relu( 6 - nn.functional.relu(x) ) 

P.S. This of course will be slower than a native support from Onnx.js

@fs-eire fs-eire added enhancement New feature or request operator Related to one or more ONNX operators labels Feb 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request operator Related to one or more ONNX operators
Projects
None yet
Development

No branches or pull requests

3 participants