无法设置本机句柄错误Tensorflow

时间:2018-03-12 14:24:24

标签: python-3.x tensorflow

我正在训练我的网上张力流,我在训练过程的某些部分得到了这个错误,虽然我无法准确说出是什么导致它,因为它总会发生在看似随意的训练中在一个或多或少随机的训练时代进行抽样。我的智慧结束了,如果有人可以在下面阐明它,我希望如此。

Traceback (most recent call last):
 File "/global/home/hpc4142/.local/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 1361, in _do_call
return fn(*args)
 File "/global/home/hpc4142/.local/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 1340, in _run_fn
target_list, status, run_metadata)
 File "/global/home/hpc4142/.local/lib/python3.5/site-packages/tensorflow/python/framework/errors_impl.py", line 516, in __exit__
  c_api.TF_GetCode(self.status.status))
tensorflow.python.framework.errors_impl.AbortedError: Operation received an exception:Status: 3, message: could not set native handle, in file tensorflow/core/kernels/mkl_conv_ops.cc:652
     [[Node: SRGAN_g/Conv4_4/Conv2D = _MklConv2D[T=DT_FLOAT, _kernel="MklOp", data_format="NHWC", padding="SAME", strides=[1, 1, 1, 1], use_cudnn_on_gpu=true, _device="/job:localhost/replica:0/task:0/device:CPU:0"](SRGAN_g/pixelshufflerx2/1/4/Relu, SRGAN_g/Conv4/W_conv2d/read, SRGAN_g/pixelshufflerx2/1/4/Relu:1, DMT/_132)]]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "main.py", line 289, in <module>
    train()
File "main.py", line 149, in train
    errM, _ = sess.run([mse_loss, g_optim_init], {t_image: b_imgs_96, t_target_image: b_imgs_384})
  File "/global/home/hpc4142/.local/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 905, in run
run_metadata_ptr)
  File "/global/home/hpc4142/.local/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 1137, in _run
feed_dict_tensor, options, run_metadata)
  File "/global/home/hpc4142/.local/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 1355, in _do_run
options, run_metadata)
  File "/global/home/hpc4142/.local/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 1374, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.AbortedError: Operation received an exception:Status: 3, message: could not set native handle, in file tensorflow/core/kernels/mkl_conv_ops.cc:652
     [[Node: SRGAN_g/Conv4_4/Conv2D = _MklConv2D[T=DT_FLOAT, _kernel="MklOp", data_format="NHWC", padding="SAME", strides=[1, 1, 1, 1], use_cudnn_on_gpu=true, _device="/job:localhost/replica:0/task:0/device:CPU:0"](SRGAN_g/pixelshufflerx2/1/4/Relu, SRGAN_g/Conv4/W_conv2d/read, SRGAN_g/pixelshufflerx2/1/4/Relu:1, DMT/_132)]]

Caused by op 'SRGAN_g/Conv4_4/Conv2D', defined at:
 File "main.py", line 289, in <module>
    train()
 File "main.py", line 53, in train
    net_g = SRGAN_g(t_image, is_train=True, reuse=False)
  File "/global/home/hpc4142/srgan-master_TF/model.py", line 51, in SRGAN_g
    recursive_layers[i] = Conv2dReuse(recursive_layers[i], 256, (3, 3), (1, 1), act=None, padding='SAME', W_init=w_init, name='n256s1/2/%s' %i, group = "Conv4")
    File "/global/home/hpc4142/srgan-master_TF/nu_layers.py", line 461, in Conv2dReuse
group = group)
  File "/global/home/hpc4142/srgan-master_TF/nu_layers.py", line 270, in __init__
self.outputs = act( tf.nn.conv2d(self.inputs, W, strides=strides, padding=padding, use_cudnn_on_gpu=use_cudnn_on_gpu, data_format=data_format) + b )
  File "/global/home/hpc4142/.local/lib/python3.5/site-packages/tensorflow/python/ops/gen_nn_ops.py", line 631, in conv2d
data_format=data_format, dilations=dilations, name=name)
  File "/global/home/hpc4142/.local/lib/python3.5/site-packages/tensorflow/python/framework/op_def_library.py", line 787, in _apply_op_helper
op_def=op_def)
  File "/global/home/hpc4142/.local/lib/python3.5/site-packages/tensorflow/python/framework/ops.py", line 3271, in create_op
op_def=op_def)
  File "/global/home/hpc4142/.local/lib/python3.5/site-packages/tensorflow/python/framework/ops.py", line 1650, in __init__
self._traceback = self._graph._extract_stack()  # pylint: disable=protected-access

AbortedError (see above for traceback): Operation received an exception:Status: 3, message: could not set native handle, in file tensorflow/core/kernels/mkl_conv_ops.cc:652
[[Node: SRGAN_g/Conv4_4/Conv2D = _MklConv2D[T=DT_FLOAT, _kernel="MklOp", data_format="NHWC", padding="SAME", strides=[1, 1, 1, 1], use_cudnn_on_gpu=true, _device="/job:localhost/replica:0/task:0/device:CPU:0"](SRGAN_g/pixelshufflerx2/1/4/Relu, SRGAN_g/Conv4/W_conv2d/read, SRGAN_g/pixelshufflerx2/1/4/Relu:1, DMT/_132)]]

0 个答案:

没有答案