tensorflow:“执行程序无法创建内核。参数无效:CPU BiasOp仅支持NHWC。”

时间:2017-08-28 05:51:37

标签: python tensorflow

当我运行我的代码时,我收到此错误:

"2017-08-27 15:32:14.257498: E tensorflow/core/common_runtime/executor.cc:644] Executor failed to create kernel. Invalid argument: CPU BiasOp only supports NHWC.
     [[Node: text_box_300/conv1/conv1_1/BiasAdd = BiasAdd[T=DT_FLOAT, data_format="NCHW", _device="/job:localhost/replica:0/task:0/cpu:0"](text_box_300/conv1/conv1_1/convolution, text_box_300/conv1/conv1_1/biases/read)]]
INFO:tensorflow:Error reported to Coordinator: <class 'tensorflow.python.framework.errors_impl.InvalidArgumentError'>, CPU BiasOp only supports NHWC.
     [[Node: text_box_300/conv1/conv1_1/BiasAdd = BiasAdd[T=DT_FLOAT, data_format="NCHW", _device="/job:localhost/replica:0/task:0/cpu:0"](text_box_300/conv1/conv1_1/convolution, text_box_300/conv1/conv1_1/biases/read)]]

Caused by op 'text_box_300/conv1/conv1_1/BiasAdd', defined at:
  File "Textbox_train.py", line 407, in <module>
    tf.app.run()
  File "/home/tian/.local/lib/python3.5/site-packages/tensorflow/python/platform/app.py", line 48, in run
    _sys.exit(main(_sys.argv[:1] + flags_passthrough))
  File "Textbox_train.py", line 291, in main
    clones = model_deploy.create_clones(deploy_config, clone_fn, [batch_queue])
  File "/home/tian/tensorflow/example/TextBoxes-TensorFlow-master/deployment/model_deploy.py", line 196, in create_clones
    outputs = model_fn(*args, **kwargs)
  File "Textbox_train.py", line 278, in clone_fn
    net.net(b_image, is_training=True, use_batch=FLAGS.use_batch)
  File "/home/tian/tensorflow/example/TextBoxes-TensorFlow-master/nets/txtbox_300.py", line 111, in net
    scope=scope)
  File "/home/tian/tensorflow/example/TextBoxes-TensorFlow-master/nets/txtbox_300.py", line 212, in text_net
    net = slim.repeat(inputs, 2, slim.conv2d, 64, [3, 3], scope='conv1')
  File "/home/tian/.local/lib/python3.5/site-packages/tensorflow/contrib/layers/python/layers/layers.py", line 2060, in repeat
    outputs = layer(outputs, *args, **kwargs)
  File "/home/tian/.local/lib/python3.5/site-packages/tensorflow/contrib/framework/python/ops/arg_scope.py", line 181, in func_with_args
    return func(*args, **current_args)
  File "/home/tian/.local/lib/python3.5/site-packages/tensorflow/contrib/layers/python/layers/layers.py", line 1027, in convolution
    outputs = layer.apply(inputs)
  File "/home/tian/.local/lib/python3.5/site-packages/tensorflow/python/layers/base.py", line 503, in apply
    return self.__call__(inputs, *args, **kwargs)
  File "/home/tian/.local/lib/python3.5/site-packages/tensorflow/python/layers/base.py", line 450, in __call__
    outputs = self.call(inputs, *args, **kwargs)
  File "/home/tian/.local/lib/python3.5/site-packages/tensorflow/python/layers/convolutional.py", line 167, in call
    outputs = nn.bias_add(outputs, self.bias, data_format='NCHW')
  File "/home/tian/.local/lib/python3.5/site-packages/tensorflow/python/ops/nn_ops.py", line 1292, in bias_add
    return gen_nn_ops._bias_add(value, bias, data_format=data_format, name=name)
  File "/home/tian/.local/lib/python3.5/site-packages/tensorflow/python/ops/gen_nn_ops.py", line 281, in _bias_add
    data_format=data_format, name=name)
  File "/home/tian/.local/lib/python3.5/site-packages/tensorflow/python/framework/op_def_library.py", line 767, in apply_op
    op_def=op_def)
  File "/home/tian/.local/lib/python3.5/site-packages/tensorflow/python/framework/ops.py", line 2630, in create_op
    original_op=self._default_original_op, op_def=op_def)
  File "/home/tian/.local/lib/python3.5/site-packages/tensorflow/python/framework/ops.py", line 1204, in __init__
    self._traceback = self._graph._extract_stack()  # pylint: disable=protected-access

InvalidArgumentError (see above for traceback): CPU BiasOp only supports NHWC.
     [[Node: text_box_300/conv1/conv1_1/BiasAdd = BiasAdd[T=DT_FLOAT, data_format="NCHW", _device="/job:localhost/replica:0/task:0/cpu:0"](text_box_300/conv1/conv1_1/convolution, text_box_300/conv1/conv1_1/biases/read)]]
..."

但我不知道它是什么意思,以及如何解决这个问题。 我运行的代码在这里:https://github.com/xiaodiu2010/TextBoxes-TensorFlow 我的电脑没有GPU。我只使用CPU,张量为1.3和python 3.5。 有人可以告诉我吗?非常感谢你!

1 个答案:

答案 0 :(得分:0)

也许您可以在这里查看GitHub讨论:https://github.com/igul222/improved_wgan_training/issues/11