tensorflow 问题汇总,持续更新...

  • (1) TypeError: Expected int32, got list containing Tensors of type '_Message' instead.
  • (2) TypeError: Expected int32, got of type 'Variable' instead.
     

解决方法:

查了很多都说要重新装TensorFlow,然后找到了下面的解决方法:

https://stackoverflow.com/questions/41813665/tensorflow-slim-typeerror-expected-int32-got-list-containing-tensors-of-type

You just have to update all the line with tf.concat

for example

net = tf.concat(3, [branch_0, branch_1, branch_2, branch_3])

should be changed to

net = tf.concat([branch_0, branch_1, branch_2, branch_3], 3)
  •  (3) AttributeError: module 'tensorflow' has no attribute 'mul'.

https://stackoverflow.com/questions/42217059/tensorflowattributeerror-module-object-has-no-attribute-mul

According to the tensorflow 1.0.0 release notes,

tf.multf.sub and tf.neg are deprecated in favor of tf.multiplytf.subtract and tf.negative.

You'll need to replace tf.mul with tf.multiply.

  •  (4) TypeError: Input 'split_dim' of 'Split' Op has type float32 that does not match expected type of int32.

https://github.com/tensorflow/models/issues/933

The documentation clearly indicates the calling order for tf.split should be:

tf.split(split_dim, num_split, value, name='split')

But the actual code indicates:

def split(value, num_or_size_splits, axis=0, num=None, name="split"):
  • (5)AttributeError: module 'tensorflow.tools.api.generator.api.nn' has no attribute 'rnn'

在新版本中,tf.nn.rnn 被 tf.nn.static_rnn 替换。

  • (6)ValueError: Only call `softmax_cross_entropy_with_logits` with named arguments (labels=..., logits=..., ...)

tf.nn.softmax_cross_entropy_with_logits(logits_expanded,labels)

更换为:

tf.reduce_mean(tf.nn.softmax_cross_entropy_with_logits(logits=logits_expanded,labels=labels))

  • (7)python版本问题:

Is generator.next() visible in python 3.0?

But instead of calling g.__next__(), as Paolo says, use next(g).

  • (8)

 

你可能感兴趣的:(tensorflow)