我正在尝试构建一个模型来着色图像。我正在使用LAB色彩空间。模型的输入是L通道,并且要训练模型以预测A和B通道。我希望通过几个卷积运行L通道,然后将其拆分为另外两个独立计算A和B通道的模型。最后,我想将它们合并在一起以获得输出。
<nav class="navbar navbar-inverse navbar-fixed-top my-navbar">
<div class="container">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/boyt2">Company Name</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li><a href="#">• Link 1<span class="sr-only">(current)</span></a></li>
<li><a href="#">Link 2</a></li>
<li>
<form class="navbar-form navbar-left searchsite" role="search">
<div class="form-group">
<input type="text" class="form-control" placeholder="Search">
</div>
<button type="submit" class="btn btn-default">Submit</button>
</form>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li class="dropdown">
<a href="#" class="dropdown-toggle avatar" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Username <span class="caret"></span> <img src="http://placehold.it/30x30"></a>
<ul class="dropdown-menu noshadow">
<li><a href="#">Action</a></li>
<li><a href="#">Another action</a></li>
<li><a href="#">Something else here</a></li>
<li role="separator" class="divider"></li>
<li><a href="#">Separated link</a></li>
</ul>
</li>
</ul>
</div><!-- /.navbar-collapse -->
</div><!-- /.container-fluid -->
</nav>
<!-- JavaScript files should be linked at the bottom of the page -->
<script src="js/jquery.min.js"></script>
<!-- Latest compiled and minified Javascript -->
<script src="js/bootstrap.min.js"></script>
当我尝试创建合并图层时出现以下错误。
model = Sequential()
model.add(InputLayer((1, H, W)))
model.add(Convolution2D(64, 5, 5, border_mode = 'same', activation = 'relu'))
model.add(Convolution2D(64, 5, 5, border_mode = 'same', activation = 'relu'))
last = Convolution2D(64, 5, 5, border_mode = 'same', activation = 'relu')
model.add(last)
a_model = Sequential()
a_model.add(last)
a_model.add(Convolution2D(64, 5, 5, border_mode = 'same', activation = 'relu'))
a_model.add(Convolution2D(64, 5, 5, border_mode = 'same', activation = 'relu'))
a_model.add(Convolution2D(1, 3, 3, border_mode = 'same', activation = 'sigmoid'))
b_model = Sequential()
b_model.add(last)
b_model.add(Convolution2D(64, 5, 5, border_mode = 'same', activation = 'relu'))
b_model.add(Convolution2D(64, 5, 5, border_mode = 'same', activation = 'relu'))
b_model.add(Convolution2D(1, 3, 3, border_mode = 'same', activation = 'sigmoid'))
model.add(Merge((a_model, b_model), mode = 'concat'))
我希望模型的外观为(2,H,W),其中H和W是图像的高度和宽度。