When I try to get output activations of a simple example with bool datatype tensors:
import tensorflow as tf
import nnef_tools.io.tf.graphdef as graphdef
def testnet_not():
x = tf.placeholder(tf.bool, shape=[6, 32, 32, 3], name='input')
return tf.logical_not(x)
tf.reset_default_graph()
with tf.Session() as sess:
result = testnet_not()
sess.run(tf.global_variables_initializer())
graphdef.save_default_graph("model.pb", session=sess, outputs={result: "output"})
the script execute.py fails with exception:
Traceback (most recent call last):
File "/nix/store/xkvjcsv75k1z7yjdwglz423wfl8biv0p-python3-3.7.9/lib/python3.7/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/nix/store/xkvjcsv75k1z7yjdwglz423wfl8biv0p-python3-3.7.9/lib/python3.7/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/nix/store/zw9kd4xk19lx26zqb3zymzmzsr1valjk-python3.7-nnef-tools-python-1.0/lib/python3.7/site-packages/nnef_tools/execute.py", line 487, in <module>
exit(main(parser.parse_args()))
File "/nix/store/zw9kd4xk19lx26zqb3zymzmzsr1valjk-python3.7-nnef-tools-python-1.0/lib/python3.7/site-packages/nnef_tools/execute.py", line 399, in main
inputs = {info.name: source(info.name, info.shape, info.dtype) for info in input_info}
File "/nix/store/zw9kd4xk19lx26zqb3zymzmzsr1valjk-python3.7-nnef-tools-python-1.0/lib/python3.7/site-packages/nnef_tools/execute.py", line 399, in <dictcomp>
inputs = {info.name: source(info.name, info.shape, info.dtype) for info in input_info}
File "/nix/store/zw9kd4xk19lx26zqb3zymzmzsr1valjk-python3.7-nnef-tools-python-1.0/lib/python3.7/site-packages/nnef_tools/execute.py", line 108, in __call__
return self._distribution(shape).astype(dtype)
TypeError: data type not understood
which arises from using of the as_numpy_dtype field as a function in the TFExecutor::input_info and in the TFExecutor::output_info functions. For this reason, the dtype field of TensorInfo tuple is assigned by an element of a tensor type, but not by the type itself.
When I try to get output activations of a simple example with bool datatype tensors:
the script
execute.py
fails with exception:which arises from using of the
as_numpy_dtype
field as a function in theTFExecutor::input_info
and in theTFExecutor::output_info
functions. For this reason, thedtype
field ofTensorInfo
tuple is assigned by an element of a tensor type, but not by the type itself.Steps to reproduce: