<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[tensorflow 模型转uff出错]]></title><description><![CDATA[<pre><code>TensorRT 5.1.5
CUDA 10.0
TensorFlow 1.13.1
</code></pre>
<p>tensorflow 模型转uff出错</p>
<pre><code>uff.model.exceptions.UffException: Transpose permutation has op ConcatV2, expected Const. Only constant permuations are supported in UFF.
</code></pre>
<p>但是根据<a href="https://docs.nvidia.com/deeplearning/sdk/tensorrt-support-matrix/index.html" target="_blank" rel="noopener noreferrer nofollow">官方文档</a><br />
ConcatV2应该是支持的</p>
]]></description><link>http://t.manaai.cn/topic/218/tensorflow-模型转uff出错</link><generator>RSS for Node</generator><lastBuildDate>Wed, 12 Aug 2026 20:24:21 GMT</lastBuildDate><atom:link href="http://t.manaai.cn/topic/218.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 28 Oct 2019 12:39:16 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to tensorflow 模型转uff出错 on Mon, 28 Oct 2019 12:39:16 GMT]]></title><description><![CDATA[<pre><code>TensorRT 5.1.5
CUDA 10.0
TensorFlow 1.13.1
</code></pre>
<p>tensorflow 模型转uff出错</p>
<pre><code>uff.model.exceptions.UffException: Transpose permutation has op ConcatV2, expected Const. Only constant permuations are supported in UFF.
</code></pre>
<p>但是根据<a href="https://docs.nvidia.com/deeplearning/sdk/tensorrt-support-matrix/index.html" target="_blank" rel="noopener noreferrer nofollow">官方文档</a><br />
ConcatV2应该是支持的</p>
]]></description><link>http://t.manaai.cn/post/502</link><guid isPermaLink="true">http://t.manaai.cn/post/502</guid><dc:creator><![CDATA[jamesguo]]></dc:creator><pubDate>Mon, 28 Oct 2019 12:39:16 GMT</pubDate></item><item><title><![CDATA[Reply to tensorflow 模型转uff出错 on Mon, 28 Oct 2019 13:51:25 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="http://t.manaai.cn/uid/178">@jamesguo</a> 在 <a href="/post/502">tensorflow 模型转uff出错</a> 中说：</p>
<blockquote>
<p>TensorRT</p>
</blockquote>
<p>TensorRT 升级到最新的6.0.1.5也还是不对</p>
]]></description><link>http://t.manaai.cn/post/503</link><guid isPermaLink="true">http://t.manaai.cn/post/503</guid><dc:creator><![CDATA[jamesguo]]></dc:creator><pubDate>Mon, 28 Oct 2019 13:51:25 GMT</pubDate></item><item><title><![CDATA[Reply to tensorflow 模型转uff出错 on Mon, 28 Oct 2019 13:53:40 GMT]]></title><description><![CDATA[<p>模型</p>
<pre><code>class TFUnetCleanModel:
    def __init__(self, image_size, image_channel, n_class, layer_count):
        self.image_channel = image_channel
        self.n_class = n_class
        self.image_size = image_size
        self.init_weight()
        self.predicts = self.build_model(layer_count=layer_count)

    def init_weight(self):
        with tf.name_scope('inputs'):
            self.image_feature = tf.placeholder(tf.float32,
                                                [None, self.image_size, self.image_size, self.image_channel],
                                                name='image_feature')

    def convolution(self, input_, num_filters, kernel_size):
        conv = tf.layers.conv2d(input_,
                                num_filters,
                                kernel_size,
                                padding=&quot;same&quot;, activation=tf.nn.relu)
        conv = tf.layers.batch_normalization(conv)
        return conv

    def max_pool(self, input_, pool_size, stride_size):
        conv = tf.layers.max_pooling2d(input_, pool_size, stride_size, padding='same')
        return conv

    def upsample_and_concat(self, layer_upper, layer_down, output_channels):
        deconv = tf.layers.conv2d_transpose(layer_upper, output_channels,
                                            kernel_size=(2, 2),
                                            strides=(2, 2))
        deconv_output = tf.concat([layer_down, deconv], -1)
        return deconv_output

    def build_model(self, layer_count, features_root=64):
        &quot;&quot;&quot;
        Creates a new convolutional unet for the given parametrization.

        :param layer_count: number of layers in the net
        :param features_root: number of features in the first layer
        &quot;&quot;&quot;
        last_down_input = self.image_feature
        down_layers = OrderedDict()
        for layer in range(0, layer_count):
            with tf.name_scope(&quot;down_conv_{}&quot;.format(str(layer))):
                num_filters = 2 ** layer * features_root
                last_down_input = self.convolution(last_down_input, num_filters, (3, 3))
                last_down_input = self.convolution(last_down_input, num_filters, (3, 3))
                down_layers[layer] = last_down_input

                last_down_input = self.max_pool(last_down_input, pool_size=(2, 2), stride_size=(2, 2))
                print(&quot;down_conv_{}.shape:{}&quot;.format(str(layer), last_down_input.get_shape()))

        num_filters = 2 ** layer_count * features_root
        last_up_input = self.convolution(last_down_input, num_filters, (3, 3))
        last_up_input = self.convolution(last_up_input, num_filters, (3, 3))
        print(&quot;last_up_input.shape:{}&quot;.format(last_up_input.get_shape()))

        for layer in range(layer_count, 0, -1):
            with tf.name_scope(&quot;up_conv_{}&quot;.format(str(layer - 1))):
                num_filters = 2 ** (layer - 1) * features_root
                last_up_input = self.upsample_and_concat(last_up_input,
                                                         down_layers[layer - 1],
                                                         num_filters)
                print(&quot;up_sample_{}.shape:{}&quot;.format(str(layer), last_up_input.get_shape()))
                last_up_input = self.convolution(last_up_input, num_filters, (3, 3))
                last_up_input = self.convolution(last_up_input, num_filters, (3, 3))
                # last_up_input = tf.nn.dropout(last_up_input, rate=1 - self.keep_prob)
                print(&quot;up_conv_{}.shape:{}&quot;.format(str(layer), last_up_input.get_shape()))

        last_up_input = self.convolution(last_up_input, 16, (3, 3))

    return last_up_input
</code></pre>
]]></description><link>http://t.manaai.cn/post/504</link><guid isPermaLink="true">http://t.manaai.cn/post/504</guid><dc:creator><![CDATA[jamesguo]]></dc:creator><pubDate>Mon, 28 Oct 2019 13:53:40 GMT</pubDate></item><item><title><![CDATA[Reply to tensorflow 模型转uff出错 on Sat, 02 Nov 2019 12:17:20 GMT]]></title><description><![CDATA[<p>uff坑比较多。其实最简单，比较通用的方式是onnx -&gt; tensorrt</p>
]]></description><link>http://t.manaai.cn/post/505</link><guid isPermaLink="true">http://t.manaai.cn/post/505</guid><dc:creator><![CDATA[刘看山]]></dc:creator><pubDate>Sat, 02 Nov 2019 12:17:20 GMT</pubDate></item></channel></rss>