Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/72.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Tensorflow XLA编译错误:操作没有Atft命名&γx27;XlaCompile';_Tensorflow_Tensorflow Xla - Fatal编程技术网

Tensorflow XLA编译错误:操作没有Atft命名&γx27;XlaCompile';

Tensorflow XLA编译错误:操作没有Atft命名&γx27;XlaCompile';,tensorflow,tensorflow-xla,Tensorflow,Tensorflow Xla,我正在运行下面的代码。我正在获得XLA编译器错误,如下所述。我有Tensorflow GPU 1.8版本,但我尝试了CPU版本,我得到了错误。但是当我将Tensorflow(CPU)降级到1.3时,我没有得到任何错误。Tensorflow是使用带有Pip的虚拟环境安装的 有人能帮我一下吗 代码: 错误日志: (?, 16, 16, 3) (?, 8, 8, 6) (?, 16, 16, 3) # <<<<< This should have printed

我正在运行下面的代码。我正在获得XLA编译器错误,如下所述。我有Tensorflow GPU 1.8版本,但我尝试了CPU版本,我得到了错误。但是当我将Tensorflow(CPU)降级到1.3时,我没有得到任何错误。Tensorflow是使用带有Pip的虚拟环境安装的

有人能帮我一下吗

代码:

错误日志:

(?, 16, 16, 3)
(?, 8, 8, 6)
(?, 16, 16, 3)     # <<<<< This should have printed (?, ?, ?, ?)

Traceback (most recent call last):
  File "/my/path/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 2327, in get_attr
    c_api.TF_OperationGetAttrValueProto(self._c_op, name, buf)
tensorflow.python.framework.errors_impl.InvalidArgumentError: Operation 'conv2d_transpose' has no attr named '_XlaCompile'.

Traceback (most recent call last):
  File "/my/path/lib/python3.6/site-packages/tensorflow/python/ops/gradients_impl.py", line 380, in _MaybeCompile
    xla_compile = op.get_attr("_XlaCompile")
  File "/my/path/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 2331, in get_attr
    raise ValueError(str(e))
ValueError: Operation 'conv2d_transpose' has no attr named '_XlaCompile'.
(?,16,16,3)
(?, 8, 8, 6)

(?,16,16,3)发生问题的原因是过滤器的形状不匹配以及与之相关的步幅,以产生所需的输出形状和有效的填充。我应该将反褶积滤波器的形状设置为[1,1,3,3],并将步长设置为[1,1,1,1]

所需代码:

deconv_filter = tf.get_variable('deconv_filter', shape=[1, 1, 6, 3], dtype=tf.float32)

deconv = tf.nn.conv2d_transpose(input_tensor, filter=deconv_filter,
    output_shape=tf.shape(input_tensor),
    strides=[1, 1, 1, 1],
    padding='VALID')
deconv_filter = tf.get_variable('deconv_filter', shape=[1, 1, 6, 3], dtype=tf.float32)

deconv = tf.nn.conv2d_transpose(input_tensor, filter=deconv_filter,
    output_shape=tf.shape(input_tensor),
    strides=[1, 1, 1, 1],
    padding='VALID')