Giter Site home page Giter Site logo

Comments (1)

dwofk avatar dwofk commented on August 24, 2024

Hi @MRinel,

We used a version of TVM that was between v0.4 and v0.5. To get the specific version of TVM used in our pipeline, please do:

git clone --recursive https://github.com/dmlc/tvm
cd tvm
git reset --hard ab4946c8b80da510a5a518dca066d8159473345f
git submodule update --init

You could then proceed with building TVM as specified here.

Operators are defined in tvm/nnvm/python/nnvm/frontend/onnx.py. You can search that file for class Upsample(OnnxOpConverter). In older versions of TVM, the Upsample operator had not yet been implemented, which may explain why you are seeing a NotImplementedError. In the version specified above, this operator had been added.

For our work, we modified this operator slightly to:

class Upsample(OnnxOpConverter):
    """ Operator converter for Upsample (nearest mode).
    """

    @classmethod
    def _impl_v7(cls, inputs, attr, params):
        scales = attr.get('scales')
        #assert len(scales) == 4 and scales[0] == 1.0 and scales[1] == 1.0 and scales[2] == scales[3]
        mode = attr.get('mode')
        if mode == b'nearest':
            method = "NEAREST_NEIGHBOR"
        elif mode == b'bilinear':
            method = "BILINEAR"
        else:
            raise ValueError("Invalid ONNX upsample mode: {}".format(mode))
        return _sym.upsampling(inputs[0], scale=2, method=method, layout='NCHW')

After modifying this file, you would need to rerun the Python package installation.

Yes, the pipeline we used was mobilenet-nnconv5dw-skipadd-pruned.pth.tar --> onnx model --> compile/deploy with TVM. We performed auto-tuning for CPU and GPU backends using AutoTVM.

from fast-depth.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.