This example is a example of MNIST-based CNN.
- Step 1 : running OCaml script
tfgraph_inf.ml
, which generates a filetf_convert_mnist.pbtxt
in current directory. - Step 2 : make sure
tf_convert_mnist.pbtxt
andtfgraph_inf.py
in the same graph; make sure Tensorflow/numpy etc. is installed. - Step 3 : execute
python tf_converter_mnist.py
, and the expected output in screen is an array of size[100]
, each element is a boolean value. There is also an value to indicate the inference accuracy.
Here we only assume the python script writer knows where to find the output node (in collection "result") and the placeholder names (x:0
).
There could be many posssible source of error at this stage, one of which could be incompatible tensorflow version; in that case,
probably find this line in test_cgraph.pbtxt : tensorflow_version: "1.12.0"
and then change the version number.
Also, Tensorflow may yield some warning messages about version/dataset etc.
Current scripts may also ignore some factors like file/directory location.