• jamesguo

    Onnx原始文件

    1. 使用TensorRT 6.0.1 OnnxParser parse错误为
      In node 0 (importModel): INVALID_GRAPH: Assertion failed: tensors.count(input_name)
    2. 使用TensorRT源码编译后的onnx2trt 命令行转换,没有报错
      没法找到具体原因

    发布在 社区求助区(SOS!!) 阅读更多
  • jamesguo

    模型

    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="same", 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):
            """
            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
            """
            last_down_input = self.image_feature
            down_layers = OrderedDict()
            for layer in range(0, layer_count):
                with tf.name_scope("down_conv_{}".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("down_conv_{}.shape:{}".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("last_up_input.shape:{}".format(last_up_input.get_shape()))
    
            for layer in range(layer_count, 0, -1):
                with tf.name_scope("up_conv_{}".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("up_sample_{}.shape:{}".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("up_conv_{}.shape:{}".format(str(layer), last_up_input.get_shape()))
    
            last_up_input = self.convolution(last_up_input, 16, (3, 3))
    
        return last_up_input
    

    发布在 社区求助区(SOS!!) 阅读更多
  • jamesguo

    @jamesguotensorflow 模型转uff出错 中说:

    TensorRT

    TensorRT 升级到最新的6.0.1.5也还是不对

    发布在 社区求助区(SOS!!) 阅读更多
  • jamesguo

    TensorRT 5.1.5
    CUDA 10.0
    TensorFlow 1.13.1
    

    tensorflow 模型转uff出错

    uff.model.exceptions.UffException: Transpose permutation has op ConcatV2, expected Const. Only constant permuations are supported in UFF.
    

    但是根据官方文档
    ConcatV2应该是支持的

    发布在 社区求助区(SOS!!) 阅读更多
  • jamesguo

    @金天 用了多少图片做训练集,我自己跑的结果一直不太理想。
    训练图跟最后的测试图需要在场景或者配色上相似度比较高么

    发布在 GAN(生成神经网络) 阅读更多
  • jamesguo

    GAN上色项目原来用了多少图片做训练集,我自己跑的结果一直不太理想。
    训练图跟最后的测试图需要在场景或者配色上相似度比较高么

    发布在 GAN(生成神经网络) 阅读更多

与 ManaAI社区 的连接断开,我们正在尝试重连,请耐心等待