You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior:
Go to '...'
设置nlu_joint.yaml 中optimizer->multitask为True
Click on '....'
run main.py
Scroll down to '....'
[ 2019-09-11 20:43:19,674 INFO base_solver.py:239 11187 ] Using multi-task optimizer
Traceback (most recent call last):
File "/home/gallup/anaconda3/envs/delta-py3.6-tf1.14/lib/python3.6/site-packages/tensorflow/python/util/nest.py", line 297, in assert_same_structure
expand_composites)
ValueError: The two structures don't have the same nested structure.
First structure: type=Tensor str=Tensor("train/cond_1/zeros:0", shape=(), dtype=float32)
More specifically: Substructure "type=IndexedSlices str=IndexedSlices(indices=Tensor("train/gradients/joint_bilstm_crf_model/embedding/embedding_lookup_grad/Reshape_1:0", shape=(?,), dtype=int32), values=Tensor("train/gradients/joint_bilstm_crf_model/embedding/embedding_lookup_grad/Reshape:0", shape=(?, 300), dtype=float32), dense_shape=Tensor("train/gradients/joint_bilstm_crf_model/embedding/embedding_lookup_grad/Const:0", shape=(2,), dtype=int32))" is a sequence, while substructure "type=Tensor str=Tensor("train/cond_1/zeros:0", shape=(), dtype=float32)" is not
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/gallup/anaconda3/envs/delta-py3.6-tf1.14/lib/python3.6/site-packages/tensorflow/python/ops/control_flow_ops.py", line 2001, in cond
nest.assert_same_structure(orig_res_t, orig_res_f, expand_composites=True)
File "/home/gallup/anaconda3/envs/delta-py3.6-tf1.14/lib/python3.6/site-packages/tensorflow/python/util/nest.py", line 304, in assert_same_structure
% (str(e), str1, str2))
ValueError: The two structures don't have the same nested structure.
First structure: type=Tensor str=Tensor("train/cond_1/zeros:0", shape=(), dtype=float32)
More specifically: Substructure "type=IndexedSlices str=IndexedSlices(indices=Tensor("train/gradients/joint_bilstm_crf_model/embedding/embedding_lookup_grad/Reshape_1:0", shape=(?,), dtype=int32), values=Tensor("train/gradients/joint_bilstm_crf_model/embedding/embedding_lookup_grad/Reshape:0", shape=(?, 300), dtype=float32), dense_shape=Tensor("train/gradients/joint_bilstm_crf_model/embedding/embedding_lookup_grad/Const:0", shape=(2,), dtype=int32))" is a sequence, while substructure "type=Tensor str=Tensor("train/cond_1/zeros:0", shape=(), dtype=float32)" is not
Entire first structure:
.
Entire second structure:
.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/gallup/study/nlp/photon/main.py", line 114, in
app.run(main)
File "/home/gallup/anaconda3/envs/delta-py3.6-tf1.14/lib/python3.6/site-packages/absl/app.py", line 300, in run
_run_main(main, args)
File "/home/gallup/anaconda3/envs/delta-py3.6-tf1.14/lib/python3.6/site-packages/absl/app.py", line 251, in _run_main
sys.exit(main(argv))
File "/home/gallup/study/nlp/photon/main.py", line 82, in main
solver.train_and_eval()
File "/home/gallup/study/nlp/photon/utils/solver/raw_solver.py", line 420, in train_and_eval
global_step)
File "/home/gallup/study/nlp/photon/utils/solver/base_solver.py", line 339, in get_train_op
global_step)
File "/home/gallup/study/nlp/photon/utils/solver/base_solver.py", line 290, in get_apply_gradients_op
grads_and_vars = self.clip_gradients(grads_and_vars, global_norm, multitask)
File "/home/gallup/study/nlp/photon/utils/solver/base_solver.py", line 269, in clip_gradients
grads_and_vars, clip_ratio)
File "/home/gallup/anaconda3/envs/delta-py3.6-tf1.14/lib/python3.6/site-packages/tensorflow/contrib/opt/python/training/multitask_optimizer_wrapper.py", line 139, in clip_gradients_by_global_norm
nonzero_gradients = [_replace_nonexisting_grad(g) for g in gradients]
File "/home/gallup/anaconda3/envs/delta-py3.6-tf1.14/lib/python3.6/site-packages/tensorflow/contrib/opt/python/training/multitask_optimizer_wrapper.py", line 139, in
nonzero_gradients = [_replace_nonexisting_grad(g) for g in gradients]
File "/home/gallup/anaconda3/envs/delta-py3.6-tf1.14/lib/python3.6/site-packages/tensorflow/contrib/opt/python/training/multitask_optimizer_wrapper.py", line 137, in _replace_nonexisting_grad
lambda: grad)
File "/home/gallup/anaconda3/envs/delta-py3.6-tf1.14/lib/python3.6/site-packages/tensorflow/python/util/deprecation.py", line 507, in new_func
return func(*args, **kwargs)
File "/home/gallup/anaconda3/envs/delta-py3.6-tf1.14/lib/python3.6/site-packages/tensorflow/python/ops/control_flow_ops.py", line 2007, in cond
"Incompatible return values of true_fn and false_fn: {}".format(e))
ValueError: Incompatible return values of true_fn and false_fn: The two structures don't have the same nested structure.
First structure: type=Tensor str=Tensor("train/cond_1/zeros:0", shape=(), dtype=float32)
More specifically: Substructure "type=IndexedSlices str=IndexedSlices(indices=Tensor("train/gradients/joint_bilstm_crf_model/embedding/embedding_lookup_grad/Reshape_1:0", shape=(?,), dtype=int32), values=Tensor("train/gradients/joint_bilstm_crf_model/embedding/embedding_lookup_grad/Reshape:0", shape=(?, 300), dtype=float32), dense_shape=Tensor("train/gradients/joint_bilstm_crf_model/embedding/embedding_lookup_grad/Const:0", shape=(2,), dtype=int32))" is a sequence, while substructure "type=Tensor str=Tensor("train/cond_1/zeros:0", shape=(), dtype=float32)" is not
Entire first structure:
.
Entire second structure:
4. See error
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
OS: [e.g. iOS]
Browser [e.g. chrome, safari]
Version [e.g. 22]
Smartphone (please complete the following information):
Device: [e.g. iPhone6]
OS: [e.g. iOS8.1]
Browser [e.g. stock browser, safari]
Version [e.g. 22]
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered:
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior:
设置nlu_joint.yaml 中optimizer->multitask为True
run main.py
[ 2019-09-11 20:43:19,674 INFO base_solver.py:239 11187 ] Using multi-task optimizer
Traceback (most recent call last):
File "/home/gallup/anaconda3/envs/delta-py3.6-tf1.14/lib/python3.6/site-packages/tensorflow/python/util/nest.py", line 297, in assert_same_structure
expand_composites)
ValueError: The two structures don't have the same nested structure.
First structure: type=Tensor str=Tensor("train/cond_1/zeros:0", shape=(), dtype=float32)
Second structure: type=IndexedSlices str=IndexedSlices(indices=Tensor("train/gradients/joint_bilstm_crf_model/embedding/embedding_lookup_grad/Reshape_1:0", shape=(?,), dtype=int32), values=Tensor("train/gradients/joint_bilstm_crf_model/embedding/embedding_lookup_grad/Reshape:0", shape=(?, 300), dtype=float32), dense_shape=Tensor("train/gradients/joint_bilstm_crf_model/embedding/embedding_lookup_grad/Const:0", shape=(2,), dtype=int32))
More specifically: Substructure "type=IndexedSlices str=IndexedSlices(indices=Tensor("train/gradients/joint_bilstm_crf_model/embedding/embedding_lookup_grad/Reshape_1:0", shape=(?,), dtype=int32), values=Tensor("train/gradients/joint_bilstm_crf_model/embedding/embedding_lookup_grad/Reshape:0", shape=(?, 300), dtype=float32), dense_shape=Tensor("train/gradients/joint_bilstm_crf_model/embedding/embedding_lookup_grad/Const:0", shape=(2,), dtype=int32))" is a sequence, while substructure "type=Tensor str=Tensor("train/cond_1/zeros:0", shape=(), dtype=float32)" is not
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/gallup/anaconda3/envs/delta-py3.6-tf1.14/lib/python3.6/site-packages/tensorflow/python/ops/control_flow_ops.py", line 2001, in cond
nest.assert_same_structure(orig_res_t, orig_res_f, expand_composites=True)
File "/home/gallup/anaconda3/envs/delta-py3.6-tf1.14/lib/python3.6/site-packages/tensorflow/python/util/nest.py", line 304, in assert_same_structure
% (str(e), str1, str2))
ValueError: The two structures don't have the same nested structure.
First structure: type=Tensor str=Tensor("train/cond_1/zeros:0", shape=(), dtype=float32)
Second structure: type=IndexedSlices str=IndexedSlices(indices=Tensor("train/gradients/joint_bilstm_crf_model/embedding/embedding_lookup_grad/Reshape_1:0", shape=(?,), dtype=int32), values=Tensor("train/gradients/joint_bilstm_crf_model/embedding/embedding_lookup_grad/Reshape:0", shape=(?, 300), dtype=float32), dense_shape=Tensor("train/gradients/joint_bilstm_crf_model/embedding/embedding_lookup_grad/Const:0", shape=(2,), dtype=int32))
More specifically: Substructure "type=IndexedSlices str=IndexedSlices(indices=Tensor("train/gradients/joint_bilstm_crf_model/embedding/embedding_lookup_grad/Reshape_1:0", shape=(?,), dtype=int32), values=Tensor("train/gradients/joint_bilstm_crf_model/embedding/embedding_lookup_grad/Reshape:0", shape=(?, 300), dtype=float32), dense_shape=Tensor("train/gradients/joint_bilstm_crf_model/embedding/embedding_lookup_grad/Const:0", shape=(2,), dtype=int32))" is a sequence, while substructure "type=Tensor str=Tensor("train/cond_1/zeros:0", shape=(), dtype=float32)" is not
Entire first structure:
.
Entire second structure:
.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/gallup/study/nlp/photon/main.py", line 114, in
app.run(main)
File "/home/gallup/anaconda3/envs/delta-py3.6-tf1.14/lib/python3.6/site-packages/absl/app.py", line 300, in run
_run_main(main, args)
File "/home/gallup/anaconda3/envs/delta-py3.6-tf1.14/lib/python3.6/site-packages/absl/app.py", line 251, in _run_main
sys.exit(main(argv))
File "/home/gallup/study/nlp/photon/main.py", line 82, in main
solver.train_and_eval()
File "/home/gallup/study/nlp/photon/utils/solver/raw_solver.py", line 420, in train_and_eval
global_step)
File "/home/gallup/study/nlp/photon/utils/solver/base_solver.py", line 339, in get_train_op
global_step)
File "/home/gallup/study/nlp/photon/utils/solver/base_solver.py", line 290, in get_apply_gradients_op
grads_and_vars = self.clip_gradients(grads_and_vars, global_norm, multitask)
File "/home/gallup/study/nlp/photon/utils/solver/base_solver.py", line 269, in clip_gradients
grads_and_vars, clip_ratio)
File "/home/gallup/anaconda3/envs/delta-py3.6-tf1.14/lib/python3.6/site-packages/tensorflow/contrib/opt/python/training/multitask_optimizer_wrapper.py", line 139, in clip_gradients_by_global_norm
nonzero_gradients = [_replace_nonexisting_grad(g) for g in gradients]
File "/home/gallup/anaconda3/envs/delta-py3.6-tf1.14/lib/python3.6/site-packages/tensorflow/contrib/opt/python/training/multitask_optimizer_wrapper.py", line 139, in
nonzero_gradients = [_replace_nonexisting_grad(g) for g in gradients]
File "/home/gallup/anaconda3/envs/delta-py3.6-tf1.14/lib/python3.6/site-packages/tensorflow/contrib/opt/python/training/multitask_optimizer_wrapper.py", line 137, in _replace_nonexisting_grad
lambda: grad)
File "/home/gallup/anaconda3/envs/delta-py3.6-tf1.14/lib/python3.6/site-packages/tensorflow/python/util/deprecation.py", line 507, in new_func
return func(*args, **kwargs)
File "/home/gallup/anaconda3/envs/delta-py3.6-tf1.14/lib/python3.6/site-packages/tensorflow/python/ops/control_flow_ops.py", line 2007, in cond
"Incompatible return values of true_fn and false_fn: {}".format(e))
ValueError: Incompatible return values of true_fn and false_fn: The two structures don't have the same nested structure.
First structure: type=Tensor str=Tensor("train/cond_1/zeros:0", shape=(), dtype=float32)
Second structure: type=IndexedSlices str=IndexedSlices(indices=Tensor("train/gradients/joint_bilstm_crf_model/embedding/embedding_lookup_grad/Reshape_1:0", shape=(?,), dtype=int32), values=Tensor("train/gradients/joint_bilstm_crf_model/embedding/embedding_lookup_grad/Reshape:0", shape=(?, 300), dtype=float32), dense_shape=Tensor("train/gradients/joint_bilstm_crf_model/embedding/embedding_lookup_grad/Const:0", shape=(2,), dtype=int32))
More specifically: Substructure "type=IndexedSlices str=IndexedSlices(indices=Tensor("train/gradients/joint_bilstm_crf_model/embedding/embedding_lookup_grad/Reshape_1:0", shape=(?,), dtype=int32), values=Tensor("train/gradients/joint_bilstm_crf_model/embedding/embedding_lookup_grad/Reshape:0", shape=(?, 300), dtype=float32), dense_shape=Tensor("train/gradients/joint_bilstm_crf_model/embedding/embedding_lookup_grad/Const:0", shape=(2,), dtype=int32))" is a sequence, while substructure "type=Tensor str=Tensor("train/cond_1/zeros:0", shape=(), dtype=float32)" is not
Entire first structure:
.
Entire second structure:
4. See error
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: