Issue 1:
I have started porting Tensorflow to Node.js and was wondering about the status of gradients support in the C and C++ APIs:

https://www.tensorflow.org/versions/r0.12/how_tos/language_bindings/index.html

https://github.com/tensorflow/tensorflow/blob/master/tensorflow/g3doc/resources/roadmap.md

Could I ask for some help and / or offer some assistance? A couple of ideas:

I would be happy to test the work-in-progress API in Node.js using either of both C or C++. I have tried both APIs and would be happy to maintain both as a test case.

I would be happy to receive some guidance from someone on the tensorflow team on how to implement gradients / training without an official API. I see from this issue (#4473) that it might be possible, but it has been hard to study the Python and OCAML code to understand what to do. Some pseudocode or links to existing code that would need to replicated could be enough.

Something else? For example, I could help move the gradient API forward by working with someone on the tensorflow team.

Let me know if you have any suggestions for a path forward. Thank you!

Issue 2:
System information

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

No

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

OS X EI Caption 10.11.6

TensorFlow installed from (source or binary):

binary (pip install)

TensorFlow version (use command below):

TensorFlow 1.2.0-rc1 CPU Only

Bazel version (if compiling from source):

Build label: 0.4.5-homebrew

Build target: bazel-out/local-

opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar

Build time: Thu Mar 16 13:37:54 2017 (1489671474)

Build timestamp: 1489671474

Build timestamp as int: 1489671474

CUDA/cuDNN version:

CPU Only

Describe the problem

Because of the buffers holding the model weight values are 77MB in size, the memory needed to load these into the app can put a lot of pressure on RAM in Android even before the model is run.

So, I need to further compress the model and round the weights,Even at the expense of accuracy.

So I build /tensorflow/tools/quantization/quantize_graph.There are something wrongs when I run quantize_graph .

Source code / logs

Source code:

bazel-bin/tensorflow/tools/quantization/quantize_graph \
–input=/Users/liba/Desktop/OptimizeCTNModel.pb \
–output=/Users/liba/Desktop/RoundedCTNModel.pb \
–output_node_names=output/outputs \
–mode=weights_rounded

log:

Traceback (most recent call last):
File "/Users/liba/Desktop/tensorflow/bazel-bin/tensorflow/tools/quantization/quantize_graph.runfiles/org_tensorflow/tensorflow/tools/quantization/quantize_graph.py", line 1301, in <module>
app.run()
File "/Users/liba/Desktop/tensorflow/bazel-bin/tensorflow/tools/quantization/quantize_graph.runfiles/org_tensorflow/tensorflow/python/platform/app.py", line 48, in run
_sys.exit(main(_sys.argv[:1] + flags_passthrough))
File "/Users/liba/Desktop/tensorflow/bazel-bin/tensorflow/tools/quantization/quantize_graph.runfiles/org_tensorflow/tensorflow/tools/quantization/quantize_graph.py", line 1267, in main
data = f.read()
File "/Users/liba/Desktop/tensorflow/bazel-bin/tensorflow/tools/quantization/quantize_graph.runfiles/org_tensorflow/tensorflow/python/lib/io/file_io.py", line 125, in read
pywrap_tensorflow.ReadFromStream(self._read_buf, length, status))
File "/Users/liba/anaconda/lib/python2.7/contextlib.py", line 24, in __exit__
self.gen.next()
File "/Users/liba/Desktop/tensorflow/bazel-bin/tensorflow/tools/quantization/quantize_graph.runfiles/org_tensorflow/tensorflow/python/framework/errors_impl.py", line 466, in raise_exception_on_not_ok_status
pywrap_tensorflow.TF_GetCode(status))
tensorflow.python.framework.errors_impl.FailedPreconditionError: .