Issue 1:
System information

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

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

TensorFlow installed from (source or binary):source

TensorFlow version:1.10

Python version:.3.6

Installed using virtualenv? pip? conda?:conda

Bazel version (if compiling from source):1.15

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

CUDA/cuDNN version:8.0

GPU model and memory:16GB

I build the libtensorflowLite.so following the #19642 (comment), and i can use it in the android project . But the .so of the libtensorflowLite.so is about 3.7M. From the document ,it should be hundreds of KB.

Here is my build commit:

bazel build -c opt //tensorflow/contrib/lite:libtensorflowLite.so
--crosstool_top=//external:android/crosstool
--cpu=arm64-v8a
--host_crosstool_top=@bazel_tools//tools/cpp:toolchain
--cxxopt="-std=c++11"
--verbose_failures

So, could someone helps me, how can I reduce the size of tflite library?

Issue 2:
Hi,

I'm testing the tf.contrib.learn example in the

https://www.tensorflow.org/get_started/tflearn

But when I executing the statement:

classifier.fit(input_fn=get_train_inputs, steps=2000)

I get the following error logs:

WARNING:tensorflow:From /usr/local/lib/python2.7/dist-packages/tensorflow/contrib/learn/python/learn/estimators/head.py:1362: scalar_summary (from tensorflow.python.ops.logging_ops) is deprecated and will be removed after 2016-11-30.

Instructions for updating:

Please switch to tf.summary.scalar. Note that tf.summary.scalar uses the node name instead of the tag. This means that TensorFlow will automatically de-duplicate summary names based on the scope they are created in. Also, passing a tensor or list of tags to a scalar summary op is no longer supported.

INFO:tensorflow:Create CheckpointSaverHook.

W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE3 instructions, but these are available on your machine and could speed up CPU computations.

W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations.

W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations.

W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations.

W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX2 instructions, but these are available on your machine and could speed up CPU computations.

W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use FMA instructions, but these are available on your machine and could speed up CPU computations.

I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:910] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero

I tensorflow/core/common_runtime/gpu/gpu_device.cc:885] Found device 0 with properties:

name: GeForce GTX 960M

major: 5 minor: 0 memoryClockRate (GHz) 1.176

pciBusID 0000:01:00.0

Total memory: 3.95GiB

Free memory: 3.24GiB

I tensorflow/core/common_runtime/gpu/gpu_device.cc:906] DMA: 0

I tensorflow/core/common_runtime/gpu/gpu_device.cc:916] 0: Y

I tensorflow/core/common_runtime/gpu/gpu_device.cc:975] Creating TensorFlow device (/gpu:0) -> (device: 0, name: GeForce GTX 960M, pci bus id: 0000:01:00.0)

E tensorflow/stream_executor/cuda/cuda_driver.cc:1002] failed to allocate 3.95G (4240965632 bytes) from device: CUDA_ERROR_OUT_OF_MEMORY

E tensorflow/stream_executor/cuda/cuda_driver.cc:1002] failed to allocate 3.55G (3816868864 bytes) from device: CUDA_ERROR_OUT_OF_MEMORY

E tensorflow/stream_executor/cuda/cuda_blas.cc:372] failed to create cublas handle: CUBLAS_STATUS_NOT_INITIALIZED

W tensorflow/stream_executor/stream.cc:1390] attempting to perform BLAS operation using StreamExecutor without BLAS support

Traceback (most recent call last):

File "", line 2, in

File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/util/deprecation.py", line 280, in new_func

return func(*args, **kwargs)

File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/learn/python/learn/estimators/estimator.py", line 426, in fit

loss = self._train_model(input_fn=input_fn, hooks=hooks)

File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/learn/python/learn/estimators/estimator.py", line 984, in _train_model

_, loss = mon_sess.run([model_fn_ops.train_op, model_fn_ops.loss])

File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/monitored_session.py", line 462, in run

run_metadata=run_metadata)

File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/monitored_session.py", line 786, in run

run_metadata=run_metadata)

File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/monitored_session.py", line 744, in run

return self._sess.run(*args, **kwargs)

File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/monitored_session.py", line 891, in run

run_metadata=run_metadata)

File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/monitored_session.py", line 744, in run

return self._sess.run(*args, **kwargs)

File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 767, in run

run_metadata_ptr)

File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 965, in _run

feed_dict_string, options, run_metadata)

File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 1015, in _do_run

target_list, options, run_metadata)

File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 1035, in _do_call

raise type(e)(node_def, op, message)

tensorflow.python.framework.errors_impl.InternalError: Blas SGEMM launch failed : a.shape=(120, 4), b.shape=(4, 10), m=120, n=10, k=4

[[Node: dnn/hiddenlayer_0/MatMul = MatMul[T=DT_FLOAT, transpose_a=false, transpose_b=false, _device="/job:localhost/replica:0/task:0/gpu:0"](dnn/input_from_feature_columns/input_from_feature_columns/concat, dnn/hiddenlayer_0/weights)]]

Caused by op u'dnn/hiddenlayer_0/MatMul', defined at:

File "", line 2, in

File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/util/deprecation.py", line 280, in new_func

return func(*args, **kwargs)

File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/learn/python/learn/estimators/estimator.py", line 426, in fit

loss = self._train_model(input_fn=input_fn, hooks=hooks)

File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/learn/python/learn/estimators/estimator.py", line 934, in _train_model

model_fn_ops = self._call_legacy_get_train_ops(features, labels)

File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/learn/python/learn/estimators/estimator.py", line 1003, in _call_legacy_get_train_ops

train_ops = self._get_train_ops(features, labels)

File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/learn/python/learn/estimators/estimator.py", line 1162, in _get_train_ops

return self._call_model_fn(features, labels, model_fn_lib.ModeKeys.TRAIN)

File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/learn/python/learn/estimators/estimator.py", line 1133, in _call_model_fn

model_fn_results = self._model_fn(features, labels, **kwargs)

File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/learn/python/learn/estimators/dnn.py", line 143, in _dnn_model_fn

scope=scope)

File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/framework/python/ops/arg_scope.py", line 177, in func_with_args

return func(*args, **current_args)

File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/layers/python/layers/layers.py", line 1409, in fully_connected

outputs = layer.apply(inputs)

File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/layers/base.py", line 303, in apply

return self.call(inputs, **kwargs)

File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/layers/base.py", line 273, in call

outputs = self.call(inputs, **kwargs)

File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/layers/core.py", line 145, in call

outputs = standard_ops.matmul(inputs, self.kernel)

File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/math_ops.py", line 1855, in matmul

a, b, transpose_a=transpose_a, transpose_b=transpose_b, name=name)

File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/gen_math_ops.py", line 1454, in _mat_mul

transpose_b=transpose_b, name=name)

File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/op_def_library.py", line 763, in apply_op

op_def=op_def)

File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 2395, in create_op

original_op=self._default_original_op, op_def=op_def)

File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 1264, in init

self._traceback = _extract_stack()

InternalError (see above for traceback): Blas SGEMM launch failed : a.shape=(120, 4), b.shape=(4, 10), m=120, n=10, k=4

[[Node: dnn/hiddenlayer_0/MatMul = MatMul[T=DT_FLOAT, transpose_a=false, transpose_b=false, _device="/job:localhost/replica:0/task:0/gpu:0"](dnn/input_from_feature_columns/input_from_feature_columns/concat, dnn/hiddenlayer_0/weights)]]

Define the test inputs

... def get_test_inputs():

... x = tf.constant(test_set.data)

... y = tf.constant(test_set.target)

... return x, y

...

classifier.fit(input_fn=get_train_inputs, steps=2000)

WARNING:tensorflow:From /usr/local/lib/python2.7/dist-packages/tensorflow/contrib/learn/python/learn/estimators/head.py:1362: scalar_summary (from tensorflow.python.ops.logging_ops) is deprecated and will be removed after 2016-11-30.

Instructions for updating:

Please switch to tf.summary.scalar. Note that tf.summary.scalar uses the node name instead of the tag. This means that TensorFlow will automatically de-duplicate summary names based on the scope they are created in. Also, passing a tensor or list of tags to a scalar summary op is no longer supported.

INFO:tensorflow:Create CheckpointSaverHook.

I tensorflow/core/common_runtime/gpu/gpu_device.cc:975] Creating TensorFlow device (/gpu:0) -> (device: 0, name: GeForce GTX 960M, pci bus id: 0000:01:00.0)

INFO:tensorflow:Saving checkpoints for 1 into /tmp/iris_model/model.ckpt.

INFO:tensorflow:loss = 1.21915, step = 1

E tensorflow/stream_executor/cuda/cuda_blas.cc:472] failed to run cuBLAS routine cublasSgemm_v2: CUBLAS_STATUS_EXECUTION_FAILED

W tensorflow/core/framework/op_kernel.cc:993] Internal: Blas SGEMM launch failed : a.shape=(120, 4), b.shape=(4, 10), m=120, n=10, k=4

[[Node: dnn/hiddenlayer_0/MatMul = MatMul[T=DT_FLOAT, transpose_a=false, transpose_b=false, _device="/job:localhost/replica:0/task:0/gpu:0"](dnn/input_from_feature_columns/input_from_feature_columns/concat, dnn/hiddenlayer_0/weights)]]

W tensorflow/core/framework/op_kernel.cc:993] Internal: Blas SGEMM launch failed : a.shape=(120, 4), b.shape=(4, 10), m=120, n=10, k=4

[[Node: dnn/hiddenlayer_0/MatMul = MatMul[T=DT_FLOAT, transpose_a=false, transpose_b=false, _device="/job:localhost/replica:0/task:0/gpu:0"](dnn/input_from_feature_columns/input_from_feature_columns/concat, dnn/hiddenlayer_0/weights)]]

Traceback (most recent call last):

File "", line 1, in

File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/util/deprecation.py", line 280, in new_func

return func(*args, **kwargs)

File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/learn/python/learn/estimators/estimator.py", line 426, in fit

loss = self._train_model(input_fn=input_fn, hooks=hooks)

File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/learn/python/learn/estimators/estimator.py", line 984, in _train_model

_, loss = mon_sess.run([model_fn_ops.train_op, model_fn_ops.loss])

File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/monitored_session.py", line 462, in run

run_metadata=run_metadata)

File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/monitored_session.py", line 786, in run

run_metadata=run_metadata)

File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/monitored_session.py", line 744, in run

return self._sess.run(*args, **kwargs)

File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/monitored_session.py", line 891, in run

run_metadata=run_metadata)

File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/monitored_session.py", line 744, in run

return self._sess.run(*args, **kwargs)

File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 767, in run

run_metadata_ptr)

File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 965, in _run

feed_dict_string, options, run_metadata)

File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 1015, in _do_run

target_list, options, run_metadata)

File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 1035, in _do_call

raise type(e)(node_def, op, message)

tensorflow.python.framework.errors_impl.InternalError: Blas SGEMM launch failed : a.shape=(120, 4), b.shape=(4, 10), m=120, n=10, k=4

[[Node: dnn/hiddenlayer_0/MatMul = MatMul[T=DT_FLOAT, transpose_a=false, transpose_b=false, _device="/job:localhost/replica:0/task:0/gpu:0"](dnn/input_from_feature_columns/input_from_feature_columns/concat, dnn/hiddenlayer_0/weights)]]

[[Node: train_op/dnn/train/update/_198 = _Recvclient_terminated=false, recv_device="/job:localhost/replica:0/task:0/cpu:0", send_device="/job:localhost/replica:0/task:0/gpu:0", send_device_incarnation=1, tensor_name="edge_175_train_op/dnn/train/update", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/cpu:0"]]

Caused by op u'dnn/hiddenlayer_0/MatMul', defined at:

File "", line 1, in

File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/util/deprecation.py", line 280, in new_func

return func(*args, **kwargs)

File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/learn/python/learn/estimators/estimator.py", line 426, in fit

loss = self._train_model(input_fn=input_fn, hooks=hooks)

File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/learn/python/learn/estimators/estimator.py", line 934, in _train_model

model_fn_ops = self._call_legacy_get_train_ops(features, labels)

File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/learn/python/learn/estimators/estimator.py", line 1003, in _call_legacy_get_train_ops

train_ops = self._get_train_ops(features, labels)

File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/learn/python/learn/estimators/estimator.py", line 1162, in _get_train_ops

return self._call_model_fn(features, labels, model_fn_lib.ModeKeys.TRAIN)

File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/learn/python/learn/estimators/estimator.py", line 1133, in _call_model_fn

model_fn_results = self._model_fn(features, labels, **kwargs)

File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/learn/python/learn/estimators/dnn.py", line 143, in _dnn_model_fn

scope=scope)

File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/framework/python/ops/arg_scope.py", line 177, in func_with_args

return func(*args, **current_args)

File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/layers/python/layers/layers.py", line 1409, in fully_connected

outputs = layer.apply(inputs)

File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/layers/base.py", line 303, in apply

return self.call(inputs, **kwargs)

File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/layers/base.py", line 273, in call

outputs = self.call(inputs, **kwargs)

File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/layers/core.py", line 145, in call

outputs = standard_ops.matmul(inputs, self.kernel)

File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/math_ops.py", line 1855, in matmul

a, b, transpose_a=transpose_a, transpose_b=transpose_b, name=name)

File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/gen_math_ops.py", line 1454, in _mat_mul

transpose_b=transpose_b, name=name)

File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/op_def_library.py", line 763, in apply_op

op_def=op_def)

File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 2395, in create_op

original_op=self._default_original_op, op_def=op_def)

File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 1264, in init

self._traceback = _extract_stack()

InternalError (see above for traceback): Blas SGEMM launch failed : a.shape=(120, 4), b.shape=(4, 10), m=120, n=10, k=4

[[Node: dnn/hiddenlayer_0/MatMul = MatMul[T=DT_FLOAT, transpose_a=false, transpose_b=false, _device="/job:localhost/replica:0/task:0/gpu:0"](dnn/input_from_feature_columns/input_from_feature_columns/concat, dnn/hiddenlayer_0/weights)]]

[[Node: train_op/dnn/train/update/_198 = _Recvclient_terminated=false, recv_device="/job:localhost/replica:0/task:0/cpu:0", send_device="/job:localhost/replica:0/task:0/gpu:0", send_device_incarnation=1, tensor_name="edge_175_train_op/dnn/train/update", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/cpu:0"]]

It seems some APIs are obsolete, can you update some new tf.contrib.learn examples in the website and make it workable with the latest version tensorflow?

And where can I get the new examples for tf.contrib.learn?

Thanks!