Skip to content
This repository was archived by the owner on Apr 29, 2021. It is now read-only.
This repository was archived by the owner on Apr 29, 2021. It is now read-only.

ONNX Conversion of DS1 graph fails #1

@bsarden

Description

@bsarden

Currently, the DS1 graph fails to export to ONNX due to the HardTanh operation not being part of the supported ONNX operators.

torch.onnx.export(model._get_network(), dummy_input, model_path, verbose=True, input_names=input_names)

> RuntimeError: ONNX export failed: Couldn't export operator aten::hardtanh

A simple fix could be to replace the nn.HardTanh operator with a custom layer that just uses torch.clamp instead, but there might be some additional code associated with module.layers, since torch.clamp expects a Tensor (i.e. not a Module). Hopefully, torch.onnx.export is smart enough convert a torch.clamp() call into the appropriate Clip operation(s).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions