![](/img/trans.png)
[英]How to calculate dimensions of the dense and output layer in convolutional neural network?
[英]convolutional neural network- how to use two cnn model on same image
我想在同一张图片上使用两个训练有素的CNN(卷积神经网络)模块。 我训练了两个模块,一个用于检测,一个用于分类。 现在,我想在同一图像上使用这两个模块。 该代码在python中使用keras和tensorflow库。 同一张图片上有两个不同的CNN
在tensorflow中,您需要为两个模型明确指定计算图 。
# build two separate graphs `g1` and `g2`
tf.reset_default_graph()
with tf.Session(graph=g1) as session:
result = sess.run(detect, feed_dict={x: test_x})
print(result)
tf.reset_default_graph()
with tf.Session(graph=g2) as session:
result = sess.run(recognize, feed_dict={x: test_x})
print(result)
在一个应用程序中构建多个图形时,也有一些警告,请参见此问题 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.