Cannot run the demo.sh file as parser_eval and conll2tree are missing
I already had tensorflow installed on my system.
Python 2.7.6 (default, Jun 22 2015, 17:58:13)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
I tensorflow/stream_executor/dso_loader.cc:105] successfully opened CUDA library libcublas.so locally
I tensorflow/stream_executor/dso_loader.cc:105] successfully opened CUDA library libcudnn.so locally
I tensorflow/stream_executor/dso_loader.cc:105] successfully opened CUDA library libcufft.so locally
I tensorflow/stream_executor/dso_loader.cc:105] successfully opened CUDA library libcuda.so.1 locally
I tensorflow/stream_executor/dso_loader.cc:105] successfully opened CUDA library libcurand.so locally
>>> tf.__version__
'0.8.0'
>>> dir(tf)
['AggregationMethod', 'Assert', 'AttrValue', 'ConfigProto', 'DType', 'Dimension', 'Event', 'FIFOQueue', 'FixedLenFeature', 'FixedLenSequenceFeature', 'FixedLengthRecordReader', 'GPUOptions', 'GRAPH_DEF_VERSION', 'GRAPH_DEF_VERSION_MIN_CONSUMER', 'GRAPH_DEF_VERSION_MIN_PRODUCER', 'Graph', 'GraphDef', 'GraphKeys', 'GraphOptions', 'HistogramProto', 'IdentityReader', 'IndexedSlices', 'InteractiveSession', 'LogMessage', 'NameAttrList', 'NoGradient', 'NodeDef', 'OpError', 'Operation', 'OptimizerOptions', 'PaddingFIFOQueue', 'Print', 'QUANTIZED_DTYPES', 'QueueBase', 'RandomShuffleQueue', 'ReaderBase', 'RegisterGradient', 'RegisterShape', 'RunMetadata', 'RunOptions', 'Session', 'SessionLog', 'SparseTensor', 'SparseTensorValue', 'Summary', 'TFRecordReader', 'Tensor', 'TensorShape', 'TextLineReader', 'VarLenFeature', 'Variable', 'VariableScope', 'WholeFileReader', '__builtins__', '__doc__', '__file__', '__name__', '__package__', '__path__', '__version__', 'abs', 'absolute_import', 'accumulate_n', 'add', 'add_check_numerics_ops', 'add_n', 'add_to_collection', 'all_variables', 'app', 'arg_max', 'arg_min', 'argmax', 'argmin', 'as_dtype', 'assert_variables_initialized', 'assign', 'assign_add', 'assign_sub', 'batch_cholesky', 'batch_fft', 'batch_fft2d', 'batch_fft3d', 'batch_ifft', 'batch_ifft2d', 'batch_ifft3d', 'batch_matmul', 'batch_matrix_determinant', 'batch_matrix_diag', 'batch_matrix_diag_part', 'batch_matrix_inverse', 'batch_matrix_solve', 'batch_matrix_solve_ls', 'batch_matrix_triangular_solve', 'batch_self_adjoint_eig', 'bfloat16', 'bfloat16_ref', 'bitcast', 'bool', 'bool_ref', 'boolean_mask', 'bytes', 'case', 'cast', 'ceil', 'check_numerics', 'cholesky', 'clip_by_average_norm', 'clip_by_global_norm', 'clip_by_norm', 'clip_by_value', 'compat', 'complex', 'complex128', 'complex128_ref', 'complex64', 'complex64_ref', 'complex_abs', 'concat', 'cond', 'conj', 'constant', 'constant_initializer', 'contrib', 'control_dependencies', 'convert_to_tensor', 'convert_to_tensor_or_indexed_slices', 'core', 'cos', 'count_up_to', 'create_partitioned_variables', 'cross', 'decode_csv', 'decode_json_example', 'decode_raw', 'delete_session_tensor', 'depth_to_space', 'deserialize_many_sparse', 'device', 'diag', 'diag_part', 'digamma', 'div', 'division', 'double', 'double_ref', 'dynamic_partition', 'dynamic_stitch', 'edit_distance', 'equal', 'erf', 'erfc', 'errors', 'exp', 'expand_dims', 'fft', 'fft2d', 'fft3d', 'fill', 'flags', 'float16', 'float16_ref', 'float32', 'float32_ref', 'float64', 'float64_ref', 'floor', 'floordiv', 'foldl', 'foldr', 'gather', 'gather_nd', 'get_collection', 'get_collection_ref', 'get_default_graph', 'get_default_session', 'get_seed', 'get_session_handle', 'get_session_tensor', 'get_variable', 'get_variable_scope', 'gfile', 'global_norm', 'gradients', 'greater', 'greater_equal', 'group', 'half', 'half_ref', 'histogram_fixed_width', 'histogram_summary', 'identity', 'ifft', 'ifft2d', 'ifft3d', 'igamma', 'igammac', 'imag', 'image', 'image_summary', 'import_graph_def', 'initialize_all_tables', 'initialize_all_variables', 'initialize_local_variables', 'initialize_variables', 'int16', 'int16_ref', 'int32', 'int32_ref', 'int64', 'int64_ref', 'int8', 'int8_ref', 'inv', 'invert_permutation', 'is_finite', 'is_inf', 'is_nan', 'is_variable_initialized', 'lbeta', 'less', 'less_equal', 'lgamma', 'lin_space', 'linspace', 'list_diff', 'listdiff', 'load_file_system_library', 'load_op_library', 'local_variables', 'log', 'logging', 'logical_and', 'logical_not', 'logical_or', 'logical_xor', 'make_template', 'map_fn', 'matching_files', 'matmul', 'matrix_determinant', 'matrix_inverse', 'matrix_solve', 'matrix_solve_ls', 'matrix_triangular_solve', 'maximum', 'merge_all_summaries', 'merge_summary', 'minimum', 'mod', 'moving_average_variables', 'mul', 'name_scope', 'neg', 'nn', 'no_op', 'no_regularizer', 'not_equal', 'one_hot', 'ones', 'ones_initializer', 'ones_like', 'op_scope', 'pack', 'pad', 'parse_example', 'parse_single_example', 'parse_single_sequence_example', 'placeholder', 'placeholder_with_default', 'pow', 'print_function', 'py_func', 'python', 'python_io', 'qint16', 'qint16_ref', 'qint32', 'qint32_ref', 'qint8', 'qint8_ref', 'quint16', 'quint16_ref', 'quint8', 'quint8_ref', 'random_crop', 'random_normal', 'random_normal_initializer', 'random_shuffle', 'random_uniform', 'random_uniform_initializer', 'range', 'rank', 'read_file', 'real', 'reduce_all', 'reduce_any', 'reduce_join', 'reduce_max', 'reduce_mean', 'reduce_min', 'reduce_prod', 'reduce_sum', 'register_tensor_conversion_function', 'reset_default_graph', 'reshape', 'resource_loader', 'reverse', 'reverse_sequence', 'round', 'rsqrt', 'saturate_cast', 'scalar_mul', 'scalar_summary', 'scan', 'scatter_add', 'scatter_sub', 'scatter_update', 'segment_max', 'segment_mean', 'segment_min', 'segment_prod', 'segment_sum', 'select', 'self_adjoint_eig', 'serialize_many_sparse', 'serialize_sparse', 'set_random_seed', 'shape', 'shape_n', 'sigmoid', 'sign', 'sin', 'size', 'slice', 'space_to_depth', 'sparse_add', 'sparse_concat', 'sparse_fill_empty_rows', 'sparse_mask', 'sparse_matmul', 'sparse_merge', 'sparse_reorder', 'sparse_retain', 'sparse_segment_mean', 'sparse_segment_mean_grad', 'sparse_segment_sqrt_n', 'sparse_segment_sqrt_n_grad', 'sparse_segment_sum', 'sparse_split', 'sparse_tensor_dense_matmul', 'sparse_tensor_to_dense', 'sparse_to_dense', 'sparse_to_indicator', 'split', 'sqrt', 'square', 'squared_difference', 'squeeze', 'stop_gradient', 'string', 'string_ref', 'string_to_hash_bucket', 'string_to_number', 'sub', 'sysconfig', 'tanh', 'test', 'tile', 'to_bfloat16', 'to_double', 'to_float', 'to_int32', 'to_int64', 'trace', 'train', 'trainable_variables', 'transpose', 'truediv', 'truncated_normal', 'truncated_normal_initializer', 'tuple', 'uint16', 'uint16_ref', 'uint8', 'uint8_ref', 'uniform_unit_scaling_initializer', 'unique', 'unique_with_counts', 'unpack', 'unsorted_segment_sum', 'user_ops', 'variable_op_scope', 'variable_scope', 'verify_tensor_all_finite', 'where', 'while_loop', 'zeros', 'zeros_initializer', 'zeros_like']
I cloned the whole models repo from github and I ran the command the following ways:
$ echo "My name is Animesh Pandey" | syntaxnet/demo.sh
syntaxnet/demo.sh: line 31: bazel-bin/syntaxnet/parser_eval: No such file or directory
syntaxnet/demo.sh: line 43: bazel-bin/syntaxnet/parser_eval: No such file or directory
syntaxnet/demo.sh: line 55: bazel-bin/syntaxnet/conll2tree: No such file or directory
$ echo "My name is Animesh Pandey" | syntaxnet/demo.sh --conll
syntaxnet/demo.sh: line 31: bazel-bin/syntaxnet/parser_eval: No such file or directory
syntaxnet/demo.sh: line 43: bazel-bin/syntaxnet/parser_eval: No such file or directory
syntaxnet/demo.sh: line 55: bazel-bin/syntaxnet/conll2tree: No such file or directory
Why am I getting those errors?
Do I need to reinstall tensorflow to use models?
Looks like you have not built the parser. Run bazel test syntaxnet/... util/...
Hi Animesh,
As smaransmarty@ says, you need to build SyntaxNet. Running bazel test syntaxnet/... util/...will build and test your installation.
Having an existing installation of TensorFlow is not sufficient because SyntaxNet uses custom ops that need to be compiled into the binary.
Cheers, Daniel
@andorardo
I tried running bazel test syntaxnet but I got the following errors:
$:~/models/syntaxnet$ bazel test syntaxnet
WARNING: /home/animesh/.cache/bazel/_bazel_animesh/88f0a91930b9aa6ad1f3500a82c97709/external/tf/WORKSPACE:1: Workspace name in /home/animesh/.cache/bazel/_bazel_animesh/88f0a91930b9aa6ad1f3500a82c97709/external/tf/WORKSPACE (@__main__) does not match the name given in the repository's definition (@tf); this will cause a build error in future versions.
ERROR: no such target '//syntaxnet:syntaxnet': target 'syntaxnet' not declared in package 'syntaxnet' defined by /home/animesh/models/syntaxnet/syntaxnet/BUILD.
INFO: Elapsed time: 0.394s
ERROR: Couldn't start the build. Unable to run tests.
What is going wrong here?
you have to give the right target which are the .bzl file. The command is as below bazel test syntaxnet/... util/...
When I run"bazel test syntaxnet/... util/..." command I get
path/.cache/bazel/_bazel_manoj-4563/136e4333e8442973ccfb66ff95d0bdd3/external/org_tensorflow/tensorflow/python/BUILD:1748:1: in cc_library rule @org_tensorflow//tensorflow/python:tf_session_helper: non-test target '@org_tensorflow//tensorflow/python:tf_session_helper' depends on testonly target '@org_tensorflow//tensorflow/python:construction_fails_op' and doesn't have testonly attribute set.
Analysis of target '//syntaxnet:conll2tree' failed; build aborted.
What to do????
What will happen if I use Bazel 0.4.0??
Using an earlier version of bazel (0.3.2) "fixes" this for me