本文整理了Java中org.tensorflow.Graph.close()
方法的一些代码示例,展示了Graph.close()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Graph.close()
方法的具体详情如下:
包路径:org.tensorflow.Graph
类名称:Graph
方法名:close
[英]Release resources associated with the Graph.
Blocks until there are no active Session instances referring to this Graph. A Graph is not usable after close returns.
[中]释放与图关联的资源。
阻塞,直到没有引用此图的活动会话实例。关闭返回后,图形不可用。
代码示例来源:origin: org.springframework.cloud.stream.app/spring-cloud-starter-stream-processor-image-recognition
@Override
public void close() throws Exception {
logger.info("Input Graph Destroyed");
if (graph != null) {
graph.close();
}
}
代码示例来源:origin: org.springframework.cloud.stream.app/spring-cloud-starter-stream-common-tensorflow
@Override
public void close() throws Exception {
logger.info("Close TensorFlow Graph!");
if (graph != null) {
graph.close();
}
}
代码示例来源:origin: spring-cloud-stream-app-starters/tensorflow
@Override
public void close() {
logger.info("Close TensorFlow Graph!");
if (graph != null) {
graph.close();
}
}
代码示例来源:origin: spring-cloud-stream-app-starters/tensorflow
@Override
public void close() throws Exception {
logger.info("Input Graph Destroyed");
if (graph != null) {
graph.close();
}
}
代码示例来源:origin: org.tensorflow/libtensorflow
/**
* Releases resources (the {@link Graph} and {@link Session}) associated with the saved model
* bundle.
*/
@Override
public void close() {
session.close();
graph.close();
}
代码示例来源:origin: org.bytedeco.javacpp-presets/tensorflow
/**
* Releases resources (the {@link Graph} and {@link Session}) associated with the saved model
* bundle.
*/
@Override
public void close() {
session.close();
graph.close();
}
代码示例来源:origin: spotify/zoltar
/** Close the model. */
@Override
public void close() {
if (instance() != null) {
LOG.debug("Closing TensorFlow session");
instance().close();
}
if (graph() != null) {
LOG.debug("Closing TensorFlow graph");
graph().close();
}
}
代码示例来源:origin: com.spotify/zoltar-tensorflow
/**
* Close the model.
*/
@Override
public void close() {
if (instance() != null) {
LOG.debug("Closing TensorFlow session");
instance().close();
}
if (graph() != null) {
LOG.debug("Closing TensorFlow graph");
graph().close();
}
}
代码示例来源:origin: org.bytedeco.javacpp-presets/tensorflow
/**
* Cleans up the state associated with this Object.
*
* <p>The TenosrFlowInferenceInterface object is no longer usable after this method returns.
*/
public void close() {
closeFeeds();
closeFetches();
sess.close();
g.close();
if (runStats != null) {
runStats.close();
}
runStats = null;
}
内容来源于网络,如有侵权,请联系作者删除!