<p dir="auto"><strong>System information</strong></p>
<ul dir="auto">
<li>OS Platform and Distribution Ubuntu 18.04 LTS</li>
<li>TensorFlow installed from source or binary): source</li>
<li>TensorFlow version (use command below): v2.0.0-alpha0-4-g2c2d508 2.0.0-alpha0</li>
<li>Python version: 3.5.7</li>
<li>Bazel version (if compiling from source): From docker image</li>
<li>GCC/Compiler version (if compiling from source): From docker image</li>
<li>CUDA/cuDNN version: NA</li>
<li>GPU model and memory: NA</li>
</ul>
<p dir="auto"><strong>Describe the current behavior</strong><br>
This documentation suggests there are 4 ways to load an optimizer:<br>
<a href="https://www.tensorflow.org/versions/r2.0/api_docs/python/tf/optimizers" rel="nofollow">https://www.tensorflow.org/versions/r2.0/api_docs/python/tf/optimizers</a></p>
<p dir="auto">However:</p>
<p dir="auto">(tf_35) mark@science:~$ python tf_optimizers.py<br>
Traceback (most recent call last):<br>
File "tf_optimizers.py", line 7, in <br>
opt4 = tf.optimizers.Adagrad<br>
AttributeError: module 'tensorflow' has no attribute 'optimizers'</p>
<p dir="auto"><strong>Describe the expected behavior</strong></p>
<p dir="auto">opt = tf.optimizers.Adagrad doesn't work. The first 3 methods do.</p>
<p dir="auto"><strong>MINIMAL code to reproduce the issue</strong></p>
<p dir="auto">import tensorflow as tf<br>
tf.<strong>version</strong></p>
<p dir="auto">opt1 = tf.compat.v2.keras.optimizers.Adagrad<br>
opt2 = tf.compat.v2.optimizers.Adagrad<br>
opt3 = tf.keras.optimizers.Adagrad<br>
opt4 = tf.optimizers.Adagrad</p>
<p dir="auto">I don't know if this is a documentation issue or a tensorflow bug.</p>
<p dir="auto">when I try to converto to tflite, occur below errors</p>
<p dir="auto">$ tflite_convert --output_file=./model1/test.tflite --keras_model_file=./model1/186-0.0481.hdf5</p>
<p dir="auto">WARNING:tensorflow:From /usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/init_ops.py:96: calling <strong>init</strong> (from tensorflow.python.ops.init_ops) with dtype is deprecated and will be removed in a future version.<br>
Instructions for updating:<br>
Call initializer instance with the dtype argument instead of passing it to the constructor<br>
WARNING:tensorflow:From /usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/init_ops.py:1253: calling <strong>init</strong> (from tensorflow.python.ops.init_ops) with dtype is deprecated and will be removed in a future version.<br>
Instructions for updating:<br>
Call initializer instance with the dtype argument instead of passing it to the constructor<br>
WARNING:tensorflow:From /usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/init_ops.py:96: calling <strong>init</strong> (from tensorflow.python.ops.init_ops) with dtype is deprecated and will be removed in a future version.<br>
Instructions for updating:<br>
Call initializer instance with the dtype argument instead of passing it to the constructor<br>
2019-02-12 18:00:17.730635: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2<br>
WARNING:tensorflow:From /usr/local/lib/python2.7/dist-packages/tensorflow/lite/python/lite.py:636: convert_variables_to_constants (from tensorflow.python.framework.graph_util_impl) is deprecated and will be removed in a future version.<br>
Instructions for updating:<br>
Use tf.compat.v1.graph_util.convert_variables_to_constants<br>
WARNING:tensorflow:From /usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/graph_util_impl.py:245: extract_sub_graph (from tensorflow.python.framework.graph_util_impl) is deprecated and will be removed in a future version.<br>
Instructions for updating:<br>
Use tf.compat.v1.graph_util.extract_sub_graph<br>
2019-02-12 18:00:18.207014: I tensorflow/core/grappler/devices.cc:53] Number of eligible GPUs (core count &gt;= 8): 0 (Note: TensorFlow was not compiled with CUDA support)<br>
2019-02-12 18:00:18.207141: I tensorflow/core/grappler/clusters/single_machine.cc:359] Starting new session<br>
2019-02-12 18:00:18.210189: E tensorflow/core/grappler/grappler_item_builder.cc:636] Init node dense/kernel/Assign doesn't exist in graph<br>
Traceback (most recent call last):<br>
File "/usr/local/bin/tflite_convert", line 10, in <br>
sys.exit(main())<br>
File "/usr/local/lib/python2.7/dist-packages/tensorflow/lite/python/tflite_convert.py", line 442, in main<br>
app.run(main=run_main, argv=sys.argv[:1])<br>
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/app.py", line 125, in run<br>
_sys.exit(main(argv))<br>
File "/usr/local/lib/python2.7/dist-packages/tensorflow/lite/python/tflite_convert.py", line 438, in run_main<br>
_convert_model(tflite_flags)<br>
File "/usr/local/lib/python2.7/dist-packages/tensorflow/lite/python/tflite_convert.py", line 191, in _convert_model<br>
output_data = converter.convert()<br>
File "/usr/local/lib/python2.7/dist-packages/tensorflow/lite/python/lite.py", line 500, in convert<br>
**converter_kwargs)<br>
File "/usr/local/lib/python2.7/dist-packages/tensorflow/lite/python/convert.py", line 442, in toco_convert_impl<br>
input_data.SerializeToString())<br>
File "/usr/local/lib/python2.7/dist-packages/tensorflow/lite/python/convert.py", line 205, in toco_convert_protos<br>
"TOCO failed. See console for info.\n%s\n%s\n" % (stdout, stderr))<br>
tensorflow.lite.python.convert.ConverterError: TOCO failed. See console for info.<br>
2019-02-12 18:00:19.028566: F tensorflow/core/framework/function.cc:1640] Check failed: GetOpGradFactory()-&gt;insert({op, func}).second Duplicated gradient for MapAccumulate<br>
Aborted (core dumped)</p>
<p dir="auto">How can I fixed it?<br>
somebody has any idea?</p>