我正在使用纯C API上的Windows 10/VisualStudio上使用Tensorflow R1.9。我尝试保存并重新加载训练有素的模型。我发现https://github.com/rockzhuang/tensorflow/commit/fb6a6f4e3dd6e663a14b672ab5c6168d62bc5 #diff-a46c94d7d7d7d7d7dc93c93c6f7a3b63b632dcc11499一个示例如何保存模型,因此我将所有功能和链接添加到我的版本中(因为在Windows 10上,我无法安装更高的版本,而不是R1.9(我将其管理以使用我的应用程序编译和运行该程序,但是现在我得到了此运行时间:
2019-04-30 09:08:55.571067: F D:srctensorflowtensorflowcoregraphgraph.cc:287] Non-OK-status: status status: Not found: Op type not registered 'NoOp' in binary running on TBK-SW19. Make sure the Op and Kernel are registered in the binary running in this process. Note that if you are loading a saved graph which used ops from tf.contrib, accessing (e.g.) 'tf.contrib.resampler' should be done before importing the graph, as contrib ops are lazily registered when the module is first accessed.
错误发生在构造函数中(graph.cc:287,addnode-函数(:
Graph::Graph(const OpRegistryInterface* ops)
: ops_(ops, FunctionDefLibrary()),
versions_(new VersionDef),
arena_(8 << 10 /* 8kB */) {
versions_->set_producer(TF_GRAPH_DEF_VERSION);
versions_->set_min_consumer(TF_GRAPH_DEF_VERSION_MIN_CONSUMER);
// Initialize the name interning table for assigned_device_name.
device_names_.push_back("");
DCHECK_EQ(0, InternDeviceName(""));
// Source and sink have no endpoints, just control edges.
NodeDef def;
def.set_name("_SOURCE");
def.set_op("NoOp");
Status status;
Node* source = AddNode(def, &status);
TF_CHECK_OK(status);
CHECK_EQ(source->id(), kSourceId);
def.set_name("_SINK");
Node* sink = AddNode(def, &status);
TF_CHECK_OK(status);
CHECK_EQ(sink->id(), kSinkId);
AddControlEdge(source, sink);
}
我期望链接问题(不是注册的内核(,但是错误消息(至少对我来说(有些误导。
在这种情况下,我可以回答自己的问题。在系统的构建/设置期间,我尝试了很多不同的事情,并且(o课程(我没有撤消其中一个测试,这导致了此错误消息。
特别是我与
链接- tensorflow contry cmake build preasure pywrap_tensorflow_internal_static.lib
- tensorflow contry cmake build preasure pywrap_tensorflow_internal.lib
我删除了这些lib的 ->重建后,程序运行。