Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InvalidArgumentError seq_lens(13) < 0 #6

Open
fengchangc opened this issue Apr 26, 2021 · 1 comment
Open

InvalidArgumentError seq_lens(13) < 0 #6

fengchangc opened this issue Apr 26, 2021 · 1 comment

Comments

@fengchangc
Copy link

Hi,
I met a problem that I can't solve. Could you please help look at this issus. Thx a lot!
It may occur at traning.py line 184 as below:

while True: try: results = sess.run(ops)

More detail:
InvalidArgumentError
seq_lens(13) < 0
[[Node: clinical_concept_extraction/copy_0/cond_2/ReverseSequence = ReverseSequence[T=DT_INT32, Tlen=DT_INT32, batch_dim=0, seq_dim=1, _device="/job:localhost/replica:0/task:0/device:CPU:0"](clinical_concept_extraction/copy_0/cond_2/rnn/transpose_1, clinical_concept_extraction/copy_0/cond_1/sub)]]

Caused by op 'clinical_concept_extraction/copy_0/cond_2/ReverseSequence', defined at:
File "/anaconda3/envs/tensorflow/lib/python3.6/runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "/anaconda3/envs/tensorflow/lib/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/Users/fengchang/.vscode/extensions/ms-python.python-2021.2.633441544/pythonFiles/lib/python/debugpy/main.py", line 45, in
cli.main()
File "/Users/fengchang/.vscode/extensions/ms-python.python-2021.2.633441544/pythonFiles/lib/python/debugpy/../debugpy/server/cli.py", line 444, in main
run()
File "/Users/fengchang/.vscode/extensions/ms-python.python-2021.2.633441544/pythonFiles/lib/python/debugpy/../debugpy/server/cli.py", line 285, in run_file
runpy.run_path(target_as_str, run_name=compat.force_str("main"))
File "/anaconda3/envs/tensorflow/lib/python3.6/runpy.py", line 263, in run_path
pkg_name=pkg_name, script_name=fname)
File "/anaconda3/envs/tensorflow/lib/python3.6/runpy.py", line 96, in _run_module_code
mod_name, mod_spec, pkg_name, script_name)
File "/anaconda3/envs/tensorflow/lib/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/Users/fengchang/Desktop/毕设代码/CE_BiLSTM-CRF/training_scripts/training.py", line 295, in
tf.app.run()
File "/anaconda3/envs/tensorflow/lib/python3.6/site-packages/tensorflow/python/platform/app.py", line 126, in run
_sys.exit(main(argv))
File "/Users/fengchang/Desktop/毕设代码/CE_BiLSTM-CRF/training_scripts/training.py", line 289, in main
train()
File "/Users/fengchang/Desktop/毕设代码/CE_BiLSTM-CRF/training_scripts/training.py", line 230, in train
train_files, train=True, reuse=False)
File "/Users/fengchang/Desktop/毕设代码/CE_BiLSTM-CRF/training_scripts/training.py", line 164, in generate_iterator_ops
ops = annotation_func_train(next_x, next_y, next_l, train=train, reuse=reuse)
File "/Users/fengchang/Desktop/毕设代码/CE_BiLSTM-CRF/training_scripts/training.py", line 55, in annotation_func_train
tf.contrib.crf.crf_decode(logits, transition_params, l)
File "/anaconda3/envs/tensorflow/lib/python3.6/site-packages/tensorflow/contrib/crf/python/ops/crf.py", line 517, in crf_decode
false_fn=_multi_seq_fn)
File "/anaconda3/envs/tensorflow/lib/python3.6/site-packages/tensorflow/python/layers/utils.py", line 206, in smart_cond
pred, true_fn=true_fn, false_fn=false_fn, name=name)
File "/anaconda3/envs/tensorflow/lib/python3.6/site-packages/tensorflow/python/framework/smart_cond.py", line 59, in smart_cond
name=name)
File "/anaconda3/envs/tensorflow/lib/python3.6/site-packages/tensorflow/python/util/deprecation.py", line 432, in new_func
return func(*args, **kwargs)
File "/anaconda3/envs/tensorflow/lib/python3.6/site-packages/tensorflow/python/ops/control_flow_ops.py", line 2072, in cond
orig_res_f, res_f = context_f.BuildCondBranch(false_fn)
File "/anaconda3/envs/tensorflow/lib/python3.6/site-packages/tensorflow/python/ops/control_flow_ops.py", line 1913, in BuildCondBranch
original_result = fn()
File "/anaconda3/envs/tensorflow/lib/python3.6/site-packages/tensorflow/contrib/crf/python/ops/crf.py", line 490, in _multi_seq_fn
backpointers, sequence_length - 1, seq_dim=1)
File "/anaconda3/envs/tensorflow/lib/python3.6/site-packages/tensorflow/python/ops/gen_array_ops.py", line 6449, in reverse_sequence
seq_dim=seq_dim, batch_dim=batch_dim, name=name)
File "/anaconda3/envs/tensorflow/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py", line 787, in _apply_op_helper
op_def=op_def)
File "/anaconda3/envs/tensorflow/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 3392, in create_op
op_def=op_def)
File "/anaconda3/envs/tensorflow/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1718, in init
self._traceback = self._graph._extract_stack() # pylint: disable=protected-access

@fengchangc
Copy link
Author

@henghuiz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant