Text classifier for Hierarchical Attention Networks for Document Classification
Apache License 2.0
1.07k
stars
379
forks
source link
ValueError: Dimensions must be equal, but are 15 and 100 for '{{node Equal}} = Equal[T=DT_BOOL, incompatible_shape_error=true](mask, SequenceMask/Less)' with input shapes: [?,15,100], [?,100,?]. #47
File "E:\Anaconda35\envs\tensorflow\lib\site-packages\tensorflow\python\framework\ops.py", line 1812, in _create_c_op
c_op = pywrap_tf_session.TF_FinishOperation(op_desc)
tensorflow.python.framework.errors_impl.InvalidArgumentError: Dimensions must be equal, but are 15 and 100 for '{{node Equal}} = Equal[T=DT_BOOL, incompatible_shape_error=true](mask, SequenceMask/Less)' with input shapes: [?,15,100], [?,100,?].
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/textClassifier/textClassifierHATT_tf2.py", line 196, in
l_lstm_sent = Bidirectional(GRU(100, return_sequences=True))(review_encoder)
File "E:\Anaconda35\envs\tensorflow\lib\site-packages\tensorflow\python\keras\layers\wrappers.py", line 530, in call
return super(Bidirectional, self).call(inputs, kwargs)
File "E:\Anaconda35\envs\tensorflow\lib\site-packages\tensorflow\python\keras\engine\base_layer.py", line 926, in call
input_list)
File "E:\Anaconda35\envs\tensorflow\lib\site-packages\tensorflow\python\keras\engine\base_layer.py", line 1117, in _functional_construction_call
outputs = call_fn(cast_inputs, *args, kwargs)
File "E:\Anaconda35\envs\tensorflow\lib\site-packages\tensorflow\python\keras\layers\wrappers.py", line 644, in call
initial_state=forward_state, kwargs)
File "E:\Anaconda35\envs\tensorflow\lib\site-packages\tensorflow\python\keras\layers\recurrent.py", line 663, in call
return super(RNN, self).call(inputs, *kwargs)
File "E:\Anaconda35\envs\tensorflow\lib\site-packages\tensorflow\python\keras\engine\base_layer.py", line 926, in call
input_list)
File "E:\Anaconda35\envs\tensorflow\lib\site-packages\tensorflow\python\keras\engine\base_layer.py", line 1117, in _functional_construction_call
outputs = call_fn(cast_inputs, args, kwargs)
File "E:\Anaconda35\envs\tensorflow\lib\site-packages\tensorflow\python\keras\layers\recurrent_v2.py", line 441, in call
inputs, initial_state, training, mask, row_lengths)
File "E:\Anaconda35\envs\tensorflow\lib\site-packages\tensorflow\python\keras\layers\recurrent_v2.py", line 501, in _defun_gru_call
normal_gru_kwargs)
File "E:\Anaconda35\envs\tensorflow\lib\site-packages\tensorflow\python\keras\layers\recurrent_v2.py", line 785, in gru_with_backend_selection
function.register(defun_gpu_gru, params)
File "E:\Anaconda35\envs\tensorflow\lib\site-packages\tensorflow\python\eager\function.py", line 3239, in register
concrete_func = func.get_concrete_function(*args, kwargs)
File "E:\Anaconda35\envs\tensorflow\lib\site-packages\tensorflow\python\eager\function.py", line 2939, in get_concrete_function
*args, *kwargs)
File "E:\Anaconda35\envs\tensorflow\lib\site-packages\tensorflow\python\eager\function.py", line 2906, in _get_concrete_function_garbage_collected
graph_function, args, kwargs = self._maybe_define_function(args, kwargs)
File "E:\Anaconda35\envs\tensorflow\lib\site-packages\tensorflow\python\eager\function.py", line 3213, in _maybe_define_function
graph_function = self._create_graph_function(args, kwargs)
File "E:\Anaconda35\envs\tensorflow\lib\site-packages\tensorflow\python\eager\function.py", line 3075, in _create_graph_function
capture_by_value=self._capture_by_value),
File "E:\Anaconda35\envs\tensorflow\lib\site-packages\tensorflow\python\framework\func_graph.py", line 986, in func_graph_from_py_func
func_outputs = python_func(func_args, func_kwargs)
File "E:\Anaconda35\envs\tensorflow\lib\site-packages\tensorflow\python\keras\layers\recurrent_v2.py", line 764, in gpu_gru_with_fallback
is_sequence_right_padded(mask, time_major),
File "E:\Anaconda35\envs\tensorflow\lib\site-packages\tensorflow\python\keras\layers\recurrent_v2.py", line 1594, in is_sequence_right_padded
return math_ops.reduce_all(math_ops.equal(mask, right_padded_mask))
File "E:\Anaconda35\envs\tensorflow\lib\site-packages\tensorflow\python\util\dispatch.py", line 201, in wrapper
return target(*args, **kwargs)
File "E:\Anaconda35\envs\tensorflow\lib\site-packages\tensorflow\python\ops\math_ops.py", line 1614, in equal
return gen_math_ops.equal(x, y, name=name)
File "E:\Anaconda35\envs\tensorflow\lib\site-packages\tensorflow\python\ops\gen_math_ops.py", line 3224, in equal
name=name)
File "E:\Anaconda35\envs\tensorflow\lib\site-packages\tensorflow\python\framework\op_def_library.py", line 744, in _apply_op_helper
attrs=attr_protos, op_def=op_def)
File "E:\Anaconda35\envs\tensorflow\lib\site-packages\tensorflow\python\framework\func_graph.py", line 593, in _create_op_internal
compute_device)
File "E:\Anaconda35\envs\tensorflow\lib\site-packages\tensorflow\python\framework\ops.py", line 3485, in _create_op_internal
op_def=op_def)
File "E:\Anaconda35\envs\tensorflow\lib\site-packages\tensorflow\python\framework\ops.py", line 1975, in init
control_input_ops, op_def)
File "E:\Anaconda35\envs\tensorflow\lib\site-packages\tensorflow\python\framework\ops.py", line 1815, in _create_c_op
raise ValueError(str(e))
ValueError: Dimensions must be equal, but are 15 and 100 for '{{node Equal}} = Equal[T=DT_BOOL, incompatible_shape_error=true](mask, SequenceMask/Less)' with input shapes: [?,15,100], [?,100,?].
File "E:\Anaconda35\envs\tensorflow\lib\site-packages\tensorflow\python\framework\ops.py", line 1812, in _create_c_op c_op = pywrap_tf_session.TF_FinishOperation(op_desc) tensorflow.python.framework.errors_impl.InvalidArgumentError: Dimensions must be equal, but are 15 and 100 for '{{node Equal}} = Equal[T=DT_BOOL, incompatible_shape_error=true](mask, SequenceMask/Less)' with input shapes: [?,15,100], [?,100,?].
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/textClassifier/textClassifierHATT_tf2.py", line 196, in
l_lstm_sent = Bidirectional(GRU(100, return_sequences=True))(review_encoder)
File "E:\Anaconda35\envs\tensorflow\lib\site-packages\tensorflow\python\keras\layers\wrappers.py", line 530, in call
return super(Bidirectional, self).call(inputs, kwargs)
File "E:\Anaconda35\envs\tensorflow\lib\site-packages\tensorflow\python\keras\engine\base_layer.py", line 926, in call
input_list)
File "E:\Anaconda35\envs\tensorflow\lib\site-packages\tensorflow\python\keras\engine\base_layer.py", line 1117, in _functional_construction_call
outputs = call_fn(cast_inputs, *args, kwargs)
File "E:\Anaconda35\envs\tensorflow\lib\site-packages\tensorflow\python\keras\layers\wrappers.py", line 644, in call
initial_state=forward_state, kwargs)
File "E:\Anaconda35\envs\tensorflow\lib\site-packages\tensorflow\python\keras\layers\recurrent.py", line 663, in call
return super(RNN, self).call(inputs, *kwargs)
File "E:\Anaconda35\envs\tensorflow\lib\site-packages\tensorflow\python\keras\engine\base_layer.py", line 926, in call
input_list)
File "E:\Anaconda35\envs\tensorflow\lib\site-packages\tensorflow\python\keras\engine\base_layer.py", line 1117, in _functional_construction_call
outputs = call_fn(cast_inputs, args, kwargs)
File "E:\Anaconda35\envs\tensorflow\lib\site-packages\tensorflow\python\keras\layers\recurrent_v2.py", line 441, in call
inputs, initial_state, training, mask, row_lengths)
File "E:\Anaconda35\envs\tensorflow\lib\site-packages\tensorflow\python\keras\layers\recurrent_v2.py", line 501, in _defun_gru_call
normal_gru_kwargs)
File "E:\Anaconda35\envs\tensorflow\lib\site-packages\tensorflow\python\keras\layers\recurrent_v2.py", line 785, in gru_with_backend_selection
function.register(defun_gpu_gru, params)
File "E:\Anaconda35\envs\tensorflow\lib\site-packages\tensorflow\python\eager\function.py", line 3239, in register
concrete_func = func.get_concrete_function(*args, kwargs)
File "E:\Anaconda35\envs\tensorflow\lib\site-packages\tensorflow\python\eager\function.py", line 2939, in get_concrete_function
*args, *kwargs)
File "E:\Anaconda35\envs\tensorflow\lib\site-packages\tensorflow\python\eager\function.py", line 2906, in _get_concrete_function_garbage_collected
graph_function, args, kwargs = self._maybe_define_function(args, kwargs)
File "E:\Anaconda35\envs\tensorflow\lib\site-packages\tensorflow\python\eager\function.py", line 3213, in _maybe_define_function
graph_function = self._create_graph_function(args, kwargs)
File "E:\Anaconda35\envs\tensorflow\lib\site-packages\tensorflow\python\eager\function.py", line 3075, in _create_graph_function
capture_by_value=self._capture_by_value),
File "E:\Anaconda35\envs\tensorflow\lib\site-packages\tensorflow\python\framework\func_graph.py", line 986, in func_graph_from_py_func
func_outputs = python_func(func_args, func_kwargs)
File "E:\Anaconda35\envs\tensorflow\lib\site-packages\tensorflow\python\keras\layers\recurrent_v2.py", line 764, in gpu_gru_with_fallback
is_sequence_right_padded(mask, time_major),
File "E:\Anaconda35\envs\tensorflow\lib\site-packages\tensorflow\python\keras\layers\recurrent_v2.py", line 1594, in is_sequence_right_padded
return math_ops.reduce_all(math_ops.equal(mask, right_padded_mask))
File "E:\Anaconda35\envs\tensorflow\lib\site-packages\tensorflow\python\util\dispatch.py", line 201, in wrapper
return target(*args, **kwargs)
File "E:\Anaconda35\envs\tensorflow\lib\site-packages\tensorflow\python\ops\math_ops.py", line 1614, in equal
return gen_math_ops.equal(x, y, name=name)
File "E:\Anaconda35\envs\tensorflow\lib\site-packages\tensorflow\python\ops\gen_math_ops.py", line 3224, in equal
name=name)
File "E:\Anaconda35\envs\tensorflow\lib\site-packages\tensorflow\python\framework\op_def_library.py", line 744, in _apply_op_helper
attrs=attr_protos, op_def=op_def)
File "E:\Anaconda35\envs\tensorflow\lib\site-packages\tensorflow\python\framework\func_graph.py", line 593, in _create_op_internal
compute_device)
File "E:\Anaconda35\envs\tensorflow\lib\site-packages\tensorflow\python\framework\ops.py", line 3485, in _create_op_internal
op_def=op_def)
File "E:\Anaconda35\envs\tensorflow\lib\site-packages\tensorflow\python\framework\ops.py", line 1975, in init
control_input_ops, op_def)
File "E:\Anaconda35\envs\tensorflow\lib\site-packages\tensorflow\python\framework\ops.py", line 1815, in _create_c_op
raise ValueError(str(e))
ValueError: Dimensions must be equal, but are 15 and 100 for '{{node Equal}} = Equal[T=DT_BOOL, incompatible_shape_error=true](mask, SequenceMask/Less)' with input shapes: [?,15,100], [?,100,?].
Process finished with exit code 1