发新帖

W tensorflow/core/framework/op_kernel.cc:1198] Invalid argument: slice index ...

[复制链接]
295 1

快来加入 TensorFlowers 大家庭!

您需要 登录 才可以下载或查看,没有帐号?加入社区

x
困扰了我好几天的问题了,求个路大神帮忙支个招,含泪跪求:
环境:Ubuntu18.04
          tensorflow1.4.0
          tensorflow-gpu 1.5.0
          python3.5
         TITAN XP 2块
跑了10000+step了,然后抛出这个错误,应该不是代码逻辑问题吧?

loaded eval model parameters from /home/prlab/THRED-master/mymodel/model_dkg/thred.ckpt-10000, time 0.15s
    ## After 500 steps, loss 5.44 - ppl 229.649
  eval dev: perplexity 226.70, time 86s, Mon Mar 11 21:45:06 2019.
    ** Best model thus far, ep 0|10000 dev_ppl 226.698
  saving config to /home/prlab/THRED-master/mymodel/model_dkg/thred_medium_config.yml
  global step 10100 lr 0.0002 step-time 0.42s wps 2.78K ppl 255.23 gN 7.86
  global step 10200 lr 0.0002 step-time 0.42s wps 2.75K ppl 247.17 gN 7.47
2019-03-11 21:46:33.588119: W tensorflow/core/framework/op_kernel.cc:1198] Invalid argument: slice index 2 of dimension 0 out of bounds.
  global step 10300 lr 0.0002 step-time 0.42s wps 2.77K ppl 259.96 gN 7.82
  global step 10400 lr 0.0002 step-time 0.42s wps 2.75K ppl 249.58 gN 7.83
2019-03-11 21:48:36.116325: W tensorflow/core/framework/op_kernel.cc:1198] Invalid argument: slice index 2 of dimension 0 out of bounds.
         [[Node: strided_slice_3 = StridedSlice[Index=DT_INT32, T=DT_STRING, begin_mask=0, ellipsis_mask=0, end_mask=0, new_axis_mask=0, shrink_axis_mask=1](StringSplit_1:1, strided_slice_3/stack, strided_slice_3/stack_1, strided_slice_3/stack_2)]]
Traceback (most recent call last):
  File "/home/prlab/anaconda3/envs/thred35/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 1350, in _do_call
    return fn(*args)
  File "/home/prlab/anaconda3/envs/thred35/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 1329, in _run_fn
    status, run_metadata)
  File "/home/prlab/anaconda3/envs/thred35/lib/python3.5/site-packages/tensorflow/python/framework/errors_impl.py", line 473, in __exit__
    c_api.TF_GetCode(self.status.status))
tensorflow.python.framework.errors_impl.InvalidArgumentError: slice index 2 of dimension 0 out of bounds.
         [[Node: strided_slice_3 = StridedSlice[Index=DT_INT32, T=DT_STRING, begin_mask=0, ellipsis_mask=0, end_mask=0, new_axis_mask=0, shrink_axis_mask=1](StringSplit_1:1, strided_slice_3/stack, strided_slice_3/stack_1, strided_slice_3/stack_2)]]
         [[Node: IteratorGetNext = IteratorGetNext[output_shapes=[[?,?], [?,?], [?], [?], [?,?], [?], [?,?], [?,?], [?]], output_types=[DT_INT32, DT_INT32, DT_INT32, DT_INT32, DT_INT32, DT_INT32, DT_INT32, DT_INT32, DT_INT32], _device="/job:localhost/replica:0/task:0/device:CPU:0"](Iterator)]]
         [[Node: thred_graph/Adam/update_thred_graph/decoder/topical_projection/bias/ApplyAdam/_1194 = _Recv[client_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:GPU:1", send_device="/job:localhost/replica:0/task:0/device:GPU:0", send_device_incarnation=1, tensor_name="edge_6545_thred_graph/Adam/update_thred_graph/decoder/topical_projection/bias/ApplyAdam", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:GPU:1"]()]]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "main.py", line 52, in <module>
    tf.app.run()
  File "/home/prlab/anaconda3/envs/thred35/lib/python3.5/site-packages/tensorflow/python/platform/app.py", line 124, in run
    _sys.exit(main(argv))
  File "main.py", line 44, in main
    model.train()
  File "/home/prlab/THRED-master/models/hierarchical_base.py", line 179, in train
    step_result = loaded_train_model.train(train_sess)
  File "/home/prlab/THRED-master/models/thred/thred_model.py", line 438, in train
    self.learning_rate])
  File "/home/prlab/anaconda3/envs/thred35/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 895, in run
    run_metadata_ptr)
  File "/home/prlab/anaconda3/envs/thred35/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 1128, in _run
    feed_dict_tensor, options, run_metadata)
  File "/home/prlab/anaconda3/envs/thred35/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 1344, in _do_run
    options, run_metadata)
  File "/home/prlab/anaconda3/envs/thred35/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 1363, in _do_call
    raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.InvalidArgumentError: slice index 2 of dimension 0 out of bounds.
         [[Node: strided_slice_3 = StridedSlice[Index=DT_INT32, T=DT_STRING, begin_mask=0, ellipsis_mask=0, end_mask=0, new_axis_mask=0, shrink_axis_mask=1](StringSplit_1:1, strided_slice_3/stack, strided_slice_3/stack_1, strided_slice_3/stack_2)]]
         [[Node: IteratorGetNext = IteratorGetNext[output_shapes=[[?,?], [?,?], [?], [?], [?,?], [?], [?,?], [?,?], [?]], output_types=[DT_INT32, DT_INT32, DT_INT32, DT_INT32, DT_INT32, DT_INT32, DT_INT32, DT_INT32, DT_INT32], _device="/job:localhost/replica:0/task:0/device:CPU:0"](Iterator)]]
         [[Node: thred_graph/Adam/update_thred_graph/decoder/topical_projection/bias/ApplyAdam/_1194 = _Recv[client_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:GPU:1", send_device="/job:localhost/replica:0/task:0/device:GPU:0", send_device_incarnation=1, tensor_name="edge_6545_thred_graph/Adam/update_thred_graph/decoder/topical_projection/bias/ApplyAdam", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:GPU:1"]()]]

我知道答案 回答被采纳将会获得10 金币 + 5 金币 已有1人回答
本楼点评(0) 收起

精彩评论1

JayJay  TF荚荚  发表于 2019-3-11 22:33:06 | 显示全部楼层
因为是基于别人的项目改得,所以只能使用老版本的tensorflow,最新版本的tensorflow改动太大
本楼点评(0) 收起
您需要登录后才可以回帖 登录 | 加入社区

本版积分规则

主题

帖子

4

积分
快速回复 返回顶部 返回列表