Issue 1:
I installed TensorFlow version 1.0.0-rc2 on Windows 7 SP1 x64 Ultimate (Python 3.5.2 |Anaconda custom (64-bit)) using:

pip install --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-1.0.0rc2-cp35-cp35m-win_amd64.whl

When I try running the test script from https://web.archive.org/web/20170214034751/https://www.tensorflow.org/get_started/os_setup#test_the_tensorflow_installation in Eclipse 4.5 or in the console:

import tensorflow as tf
print('TensorFlow version: {0}'.format(tf.__version__))
hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()
print(sess.run(hello))

I obtain some error message:

TensorFlow version: 1.0.0-rc2
'Hello, TensorFlow!'
E c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflob
w\core\framework\op_kernel.cc:943] OpKernel ('op: "BestSplits" device_type: "CPU"') for unknown op: BestSplits
E c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('op: "CountExtremelyRandomStats" device_type: "CPU"') for unknown op: CountExtremelyRandomStats
E c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('op: "FinishedNodes" device_type: "CPU"') for unknown op: FinishedNodes
E c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('op: "GrowTree" device_type: "CPU"') for unknown op: GrowTree
E c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('op: "ReinterpretStringToFloat" device_type: "CPU"') for unknown op: ReinterpretStringToFloat
E c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('op: "SampleInputs" device_type: "CPU"') for unknown op: SampleInputs
E c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('op: "ScatterAddNdim" device_type: "CPU"') for unknown op: ScatterAddNdim
E c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('op: "TopNInsert" device_type: "CPU"') for unknown op: TopNInsert
E c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('op: "TopNRemove" device_type: "CPU"') for unknown op: TopNRemove
E c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('op: "TreePredictions" device_type: "CPU"') for unknown op: TreePredictions
E c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('op: "UpdateFertileSlots" device_type: "CPU"') for unknown op: UpdateFertileSlots

Why?

I didn't have such issues with TensorFlow 0.12.1 (installed with pip install tensorflow==0.12.1):

TensorFlow version: 0.12.1
b'Hello, TensorFlow!'

Stack Exchange thread: TensorFlow version 1.0.0-rc2 on Windows: "OpKernel ('op: "BestSplits" device_type: "CPU"') for unknown op: BestSplits" with test code

@drpngx

Issue 2:
System information

Have I written custom code (as opposed to using a stock example script provided in TensorFlow):

OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Ubuntu 16.04

Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device:

TensorFlow installed from (source or binary): source

TensorFlow version (use command below): 1.10.1

Python version: 3.5

Bazel version (if compiling from source): 0.15.1

GCC/Compiler version (if compiling from source): 5

CUDA/cuDNN version: 9.0 / 7.0

GPU model and memory:

Describe the problem

I successfully build from source TF 1.10.1 with TensorRT 3.04 support. Using the Python tensorflow.contrib.tensorrt API, I can create a protobuf that contains some TRTEngineOp operations, giving me a substantial inference speed-up.

However, now I need to run this optimized protobuf via a C++ API. I build the required .so libraries for the C++ inference API (such as libtensorflow.so, libtensorflow_cc.so and libtensorflow_framework.so). I can successfully load and run inference on the native TF protobuf, but not on the TRT optimized protobuf.

It gives me an error saying that TRTEngineOp not available. Looking through Stackoverflow, I found some suggestions to use TF_LoadLibrary in the C API to load the python/ops/_trt_engine_op.so available in tensorflow/contrib/tensorrt. When I do this, the TRTEngineOp not available error disappears, but now it complains that it has no registered kernels. I noticed that the python/ops/_trt_engine_op.so Bazel target does not include any kernel definition, which explains why the TF_LoadLibrary doesn't find any kernels I guess. I am wondering how the Python API loads this. Can anyone help? Is it possible to run TensorRT optimized protobufs in C++ ?

Steps to reproduce

Create an optimized protobuf in python, following for example this blog from Google

# Reserve memory for TensorRT inference engine
gpu_options = tf.GPUOptions(per_process_gpu_memory_fraction = number_between_0_and_1)
...
trt_graph = trt.create_inference_graph(
input_graph_def = frozen_graph_def,
outputs = output_node_name,
max_batch_size=batch_size,
max_workspace_size_bytes=workspace_size,
precision_mode=precision) # Get optimized graph

then save as protobuf file.

Load optimized protobuf in C++, where we have access to the libtensorflow.so, libtensorflow_cc.so and libtensorflow_framework.so precompiled.

#include <tensorflow/core/graph/graph.h>
#include <tensorflow/core/graph/default_device.h>
#include <cuda_runtime.h>
#include tensorflow/c/c_api.h

auto status = TF_NewStatus();
TF_LoadLibrary(getPathToTrtEngineOpSo(), status);

tensorflow::SessionOptions sessionOptions;
sessionOptions.config.set_allow_soft_placement(getAllowSoftPlacement());
sessionOptions.config.set_log_device_placement(getLogDevicePlacement());
auto gpu_options = sessionOptions.config.mutable_gpu_options();
gpu_options->set_allow_growth(getAllowMemoryGrowth());
gpu_options->set_per_process_gpu_memory_fraction(getMemoryFraction());
_session.reset(tensorflow::NewSession(sessionOptions));

tensorflow::GraphDef graphDef;
checkStatusTF(tensorflow::ReadBinaryProto(tensorflow::Env::Default(),
getModel(),
&graphDef),
_logger);
tensorflow::graph::SetDefaultDevice(getDevice(), &graphDef);
checkStatusTF(_session->Create(graphDef), _logger);

followed by the appropriate run call.

The libtensorflow_cc.so, libtensorflow_framework.so and libtensorflow.so are unmodified targets from Tensorflow repostory r1.10.