运行tensorflow
模型会生成以下错误消息。谷歌搜索它似乎是由tensorflow version being < 0.12.0引起的。我使用的tensorflow版本是0.12.0-rc0
。
File "/home/ug/GPU-Study/keras/FCN/fcn/tensorflow_fcn/fcn8_vgg.py", line 60, in build
red, green, blue = tf.split(rgb, 3, 3)
File "/devl/tensorflow/tf_0.12/lib/python3.4/site-packages/tensorflow/python/ops/array_ops.py", line 1159, in split
name=name)
File "/devl/tensorflow/tf_0.12/lib/python3.4/site-packages/tensorflow/python/ops/gen_array_ops.py", line 3241, in _split
num_split=num_split, name=name)
File "/devl/tensorflow/tf_0.12/lib/python3.4/site-packages/tensorflow/python/framework/op_def_library.py", line 508, in apply_op
(prefix, dtypes.as_dtype(input_arg.type).name))
TypeError: Input 'split_dim' of 'Split' Op has type float32 that does not match expected type of int32.
答案 0 :(得分:0)
在linked SO post above中,@ alphaleonis指出Tensorflow 0.12.0-rc0和0.12.0-rc1是仍包含旧语法的预发行版本。新的语法更改直到v0.12.0才生效。
因此请更新v0.12或更高版本v1.0.0。祝你好运!
<强>更新强>:
如果您无法更新基础库,那么您应该使用tf.split
的上一个/旧版/ pre-v0.12签名:
# tf.split(axis, num_or_size_splits, value)
在您的情况下使用:
red, green, blue = tf.split(3, 3, rgb)