Issue 1:
System information

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

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

TensorFlow installed from (source or binary): source

TensorFlow version (use command below): 1.6

Python version: 3.6.3

Bazel version (if compiling from source): 0.9

CUDA/cuDNN version: 9/7

GPU model and memory: 1080Ti & 12G

Exact command to reproduce:

I wrote MobileNet code to train a model from scratch. Also tried using MobileNet keras function for training but none of the model converts to tflite.

I am running following command

./bazel-bin/tensorflow/contrib/lite/toco/toco --input_file=/MobileNet-trined.pb --input_format=TENSORFLOW_GRAPHDEF --output_format=TFLITE --output_file=train-1.tflite --inference_type=FLOAT --input_arrays=input_1 --output_arrays=dense_1/Sigmoid --allow_custom_ops

It gives me following result

2018-04-17 15:25:11.070338: I tensorflow/contrib/lite/toco/import_tensorflow.cc:1236] Converting unsupported operation: RandomUniform
2018-04-17 15:25:11.098993: I tensorflow/contrib/lite/toco/graph_transformations/graph_transformations.cc:39] Before Removing unused ops: 865 operators, 1364 arrays (0 quantized)
2018-04-17 15:25:11.139921: I tensorflow/contrib/lite/toco/graph_transformations/graph_transformations.cc:39] After Removing unused ops pass 1: 809 operators, 1280 arrays (0 quantized)
2018-04-17 15:25:11.183528: I tensorflow/contrib/lite/toco/graph_transformations/graph_transformations.cc:39] Before general graph transformations: 809 operators, 1280 arrays (0 quantized)
1984959600
2006980784
2018-04-17 15:25:11.184242: F tensorflow/contrib/lite/toco/graph_transformations/resolve_batch_normalization.cc:90] Check failed: mean_shape.dims() == multiplier_shape.dims()
Abort trap: 6

Issue 2:
System information

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

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

TensorFlow installed from (source or binary): source

TensorFlow version (use command below): r1.6 commit: cbc6580

Python version: 3.5.2

Bazel version (if compiling from source): 0.11.1

GCC/Compiler version (if compiling from source): gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.9)

CUDA/cuDNN version: N/A (build without support CUDA)

GPU model and memory: N/A (build without support CUDA)

Exact command to reproduce:

Describe the problem

Trained model, successfully froze, it works on the tensorflow android, using TensorFlowInferenceInterface.

I try to convert this into a TF Lite format, but I get an error.

Source code / logs

bazel-bin/tensorflow/contrib/lite/toco/toco \
--input_file=./test_model/frozen_graph.pb \
--input_format=TENSORFLOW_GRAPHDEF \
--output_file=./test_model/unet.tflite \
--output_format=TFLITE \
--input_array='input' \
--input_data_type=FLOAT \
--input_shape=2,192,320,1 \
--inference_type=FLOAT \
--inference_input_type=FLOAT \
--output_array='final/Sigmoid' \
--v=1

2018-03-13 21:07:12.711948: I tensorflow/contrib/lite/toco/graph_transformations/graph_transformations.cc:39] Before Removing unused ops: 282 operators, 479 arrays (0 quantized)
2018-03-13 21:07:12.716274: I tensorflow/contrib/lite/toco/graph_transformations/graph_transformations.cc:39] Before general graph transformations: 282 operators, 479 arrays (0 quantized)
2018-03-13 21:07:12.716893: F tensorflow/contrib/lite/toco/graph_transformations/resolve_batch_normalization.cc:86] Check failed: mean_shape.dims() == multiplier_shape.dims()
Aborted (core dumped)