没有内核映像可用于在设备上执行

时间:2018-04-11 08:01:33

标签: tensorflow

我训练maskrcnn,使用tf-1.2可以训练,但我用tf-1.5就不训练了

错误如下:

Caused by op u'pyramid_1/AssignGTBoxes/Where_6', defined at:
  File "/home/zhouzd2/letrain/applications/letrain.py", line 349, in <module>
    tf.app.run()
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/app.py", line 124, in run
    _sys.exit(main(argv))
  File "/home/zhouzd2/letrain/applications/letrain.py", line 346, in main
    LeTrain().model_train(user_mode)
  File "/home/zhouzd2/letrain/platform/base_train.py", line 1228, in model_train
    cluster=self.cluster_spec)
  File "/home/zhouzd2/letrain/platform/deployment/model_deploy.py", line 226, in create_clones
    outputs, feed_ops,verify_model_loss = model_fn(*args, **kwargs)
  File "/home/zhouzd2/letrain/platform/base_train.py", line 1195, in clone_fn
    model_loss, end_points, feed_ops = network_fn(data_direct, data_batch, int_network_fn)
  File "/home/zhouzd2/letrain/applications/letrain.py", line 214, in get_loss
    FLAGS.batch_size)
  File "/home/zhouzd2/letrain/applications/fmrcnn/get_fmrcnn_loss.py", line 23, in model_fn
    loss_weights=[0.2, 0.2, 1.0, 0.2, 1.0])
  File "/home/zhouzd2/letrain/applications/fmrcnn/libs/nets/pyramid_network.py", line 580, in build
    is_training=is_training, gt_boxes=gt_boxes)
  File "/home/zhouzd2/letrain/applications/fmrcnn/libs/nets/pyramid_network.py", line 263, in build_heads
    assign_boxes(rois, [rois, batch_inds], [2, 3, 4, 5])
  File "/home/zhouzd2/letrain/applications/fmrcnn/libs/layers/wrapper.py", line 173, in assign_boxes
    inds = tf.where(tf.equal(assigned_layers, l))
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/array_ops.py", line 2538, in where
    return gen_array_ops.where(condition=condition, name=name)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/gen_array_ops.py", line 6087, in where
    "Where", input=condition, name=name)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/op_def_library.py", line 787, in _apply_op_helper
    op_def=op_def)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 3160, in create_op
    op_def=op_def)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 1625, in __init__
    self._traceback = self._graph._extract_stack()  # pylint: disable=protected-access

InternalError (see above for traceback): WhereOp: Could not launch cub::DeviceReduce::Sum to count number of true / nonzero indices.  temp_storage_bytes: 1, status: no kernel image is available for execution on the device
     [[Node: pyramid_1/AssignGTBoxes/Where_6 = Where[T=DT_BOOL, _device="/job:worker/replica:0/task:0/device:GPU:0"](pyramid_1/AssignGTBoxes/Equal_6_S9493)]]
     [[Node: pyramid_1/AssignGTBoxes/Reshape_8_G1028 = _Recv[client_terminated=false, recv_device="/job:worker/replica:0/task:0/device:CPU:0", send_device="/job:worker/replica:0/task:0/device:GPU:0", send_device_incarnation=5407481677180697062, tensor_name="edge_1349_pyramid_1/AssignGTBoxes/Reshape_8", tensor_type=DT_INT64, _device="/job:worker/replica:0/task:0/device:CPU:0"]()]]

加载计算图时没问题,sess.run()中报告错误。 有谁知道如何解决这个问题?或者有谁知道什么功能可以取代tf.where? 谢谢!

1 个答案:

答案 0 :(得分:0)

如果您使用的是 Visual Studio

右键单击项目>属性> Cuda C / C ++>设备

并将以下内容添加到代码生成字段

compute_30,sm_30;compute_35,sm_35;compute_37,sm_37;compute_50,sm_50;compute_52,sm_52;compute_60,sm_60;compute_61,sm_61;compute_70,sm_70;compute_75,sm_75;