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

babi-dialog task6 #8

Open
jasonwu0731 opened this issue Sep 26, 2017 · 4 comments
Open

babi-dialog task6 #8

jasonwu0731 opened this issue Sep 26, 2017 · 4 comments

Comments

@jasonwu0731
Copy link

Everything works for me except the babi-dialog task6.

python -m prepro-dialog --task 6

python -m dialog.main --noload --task 6

Error message here:

Traceback (most recent call last):
  File "/home/jason/anaconda2/lib/python2.7/runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/home/jason/anaconda2/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/home/jason/qrn/dialog/main.py", line 281, in <module>
    tf.app.run()
  File "/home/jason/anaconda2/lib/python2.7/site-packages/tensorflow/python/platform/app.py", line 48, in run
    _sys.exit(main(_sys.argv[:1] + flags_passthrough))
  File "/home/jason/qrn/dialog/main.py", line 172, in main
    summary = _main(config, num_trials)
  File "/home/jason/qrn/dialog/main.py", line 238, in _main
    runner.initialize()
  File "dialog/base_model.py", line 65, in initialize
    tower.initialize()
  File "dialog/model.py", line 182, in initialize
    A = Alist[0] if self.rnn else Alist[i]
IndexError: list index out of range

Can you help? Thanks :)

@shmsw25
Copy link
Collaborator

shmsw25 commented Sep 26, 2017

Sorry for the inconvenience. Could you change this line 6 : range(11) to be 6: range(8) ?

@jasonwu0731
Copy link
Author

@shmsw25 Thank you for your response! After I change that line, I got the following error.

Caused by op u'towers/gpu_0/loss/ans_loss/SparseSoftmaxCrossEntropyWithLogits_4/SparseSoftmaxCrossEntropyWithLogits', defined at:
  File "/home/jason/anaconda2/lib/python2.7/runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/home/jason/anaconda2/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/home/jason/qrn/dialog/main.py", line 281, in <module>
    tf.app.run()
  File "/home/jason/anaconda2/lib/python2.7/site-packages/tensorflow/python/platform/app.py", line 48, in run
    _sys.exit(main(_sys.argv[:1] + flags_passthrough))
  File "/home/jason/qrn/dialog/main.py", line 172, in main
    summary = _main(config, num_trials)
  File "/home/jason/qrn/dialog/main.py", line 238, in _main
    runner.initialize()
  File "dialog/base_model.py", line 65, in initialize
    tower.initialize()
  File "dialog/model.py", line 332, in initialize
    ce = tf.nn.sparse_softmax_cross_entropy_with_logits(logits=logits[i], labels=_y)
  File "/home/jason/anaconda2/lib/python2.7/site-packages/tensorflow/python/ops/nn_ops.py", line 1690, in sparse_softmax_cross_entropy_with_logits
    precise_logits, labels, name=name)
  File "/home/jason/anaconda2/lib/python2.7/site-packages/tensorflow/python/ops/gen_nn_ops.py", line 2486, in _sparse_softmax_cross_entropy_with_logits
    features=features, labels=labels, name=name)
  File "/home/jason/anaconda2/lib/python2.7/site-packages/tensorflow/python/framework/op_def_library.py", line 767, in apply_op
    op_def=op_def)
  File "/home/jason/anaconda2/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 2506, in create_op
    original_op=self._default_original_op, op_def=op_def)
  File "/home/jason/anaconda2/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 1269, in __init__
    self._traceback = _extract_stack()

InvalidArgumentError (see above for traceback): Must have at least one class, but got logits shape [32,0]
	 [[Node: towers/gpu_0/loss/ans_loss/SparseSoftmaxCrossEntropyWithLogits_4/SparseSoftmaxCrossEntropyWithLogits = SparseSoftmaxCrossEntropyWithLogits[T=DT_FLOAT, Tlabels=DT_INT32, _device="/job:localhost/replica:0/task:0/gpu:0"](towers/gpu_0/class/Linear_4/out4, towers/gpu_0/loss/ans_loss/Gather_8/_167)]]
	 [[Node: towers/gpu_0/gradients/concat/_199 = _Recv[client_terminated=false, recv_device="/job:localhost/replica:0/task:0/cpu:0", send_device="/job:localhost/replica:0/task:0/gpu:0", send_device_incarnation=1, tensor_name="edge_2517_towers/gpu_0/gradients/concat", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/cpu:0"]()]]

Thank you for the further help 👍

@mhmda
Copy link

mhmda commented Sep 28, 2017

I managed to solve the problem by changing 6 : range(11) to 6: range(4).

@jasonwu0731
Copy link
Author

@mhmda yes, you are right. Should change to 4

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

3 participants