Giter VIP home page Giter VIP logo

Comments (10)

yuanzexi avatar yuanzexi commented on May 3, 2024 1

@ys0232 In the latest commit eb0eb94, Forward can support 'Flatten' Op. You could try it. And we'll support tf.depth_to_space soon.

from forward.

ys0232 avatar ys0232 commented on May 3, 2024

Another unsupport operation is tf.depth_to_space, it in torch is "PixelShuffle". Thanks for helping!

from forward.

ys0232 avatar ys0232 commented on May 3, 2024

Nice work! @yuanzexi

from forward.

ys0232 avatar ys0232 commented on May 3, 2024

There are another "Reshape" pattern like "Flatten". However, it doesn't work in Forward-1.1.0. Please help to support "Reshape" to tensorrt, thanks! Create model code look like this.@yuanzexi

def create_tf_reshape(model_file):
    import tensorflow as tf
    import tf_slim as slim
    with tf.Session() as sess:
        x1 = tf.placeholder(shape=(1,None,None,27),dtype=tf.float32, name='x')

        #op = slim.flatten(x1)
        gs = tf.shape(x1)
        op = tf.reshape(x1,shape=(1,gs[1],gs[2],3,9),name='reshape')

        sess.run(tf.global_variables_initializer())
        feed_dict = {x1: np.ones((1,12,12,27))}
        print(sess.run(op, feed_dict))

        graphdef = tf.graph_util.convert_variables_to_constants(sess, sess.graph_def, ['reshape'])
        tf.train.write_graph(graphdef, './', model_file, as_text=False)
        return feed_dict

from forward.

yuanzexi avatar yuanzexi commented on May 3, 2024

There are another "Reshape" pattern like "Flatten". However, it doesn't work in Forward-1.1.0. Please help to support "Reshape" to tensorrt, thanks! Create model code look like this.@yuanzexi

def create_tf_reshape(model_file):
    import tensorflow as tf
    import tf_slim as slim
    with tf.Session() as sess:
        x1 = tf.placeholder(shape=(1,None,None,27),dtype=tf.float32, name='x')

        #op = slim.flatten(x1)
        gs = tf.shape(x1)
        op = tf.reshape(x1,shape=(1,gs[1],gs[2],3,9),name='reshape')

        sess.run(tf.global_variables_initializer())
        feed_dict = {x1: np.ones((1,12,12,27))}
        print(sess.run(op, feed_dict))

        graphdef = tf.graph_util.convert_variables_to_constants(sess, sess.graph_def, ['reshape'])
        tf.train.write_graph(graphdef, './', model_file, as_text=False)
        return feed_dict

@ys0232 So far, Forward only support DYNAMIC BATCH dim, so using shape=(1, None, None, 27) as input is invalid.

from forward.

ys0232 avatar ys0232 commented on May 3, 2024

Another unsupport operation is tf.depth_to_space, it in torch is "PixelShuffle". Thanks for helping!

@yuanzexi Could help to support tf.depth_to_space and pytorch.PixelShuffle ?

from forward.

github-actions avatar github-actions commented on May 3, 2024

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

from forward.

github-actions avatar github-actions commented on May 3, 2024

This issue was closed because it has been stalled for 5 days with no activity.

from forward.

yuanzexi avatar yuanzexi commented on May 3, 2024

@ys0232 Sorry for late reply. tf.depth_to_space and pytorch.PixelShuffle are now supported in Release v1.2.2.

from forward.

github-actions avatar github-actions commented on May 3, 2024

This issue was closed because it has been stalled for 5 days with no activity.

from forward.

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.