Distributed Tensorflow: TypeError: __init__() got multiple values for keyword argument 'dtype'

Distributed Tensorflow: TypeError: __init__() got multiple values for keyword argument 'dtype'

当运行分布式tensorflow跟随inception distributed training tutorial时,我遇到了以下错误:

Traceback (most recent call last):
  File "/home/AIJ/tf_models/models/inception/bazel-bin/inception/imagenet_distributed_train.runfiles/inception/inception/imagenet_distributed_train.py", line 65, in <module>
    tf.app.run()
  File "/home/AIJ/tensorflow/_python_build/tensorflow/python/platform/app.py", line 44, in run
    _sys.exit(main(_sys.argv[:1] + flags_passthrough))
  File "/home/AIJ/tf_models/models/inception/bazel-bin/inception/imagenet_distributed_train.runfiles/inception/inception/imagenet_distributed_train.py", line 61, in main
    inception_distributed_train.train(server.target, dataset, cluster_spec)
  File "/home/AIJ/tf_models/models/inception/bazel-bin/inception/imagenet_distributed_train.runfiles/inception/inception/inception_distributed_train.py", line 120, in train
    global_step = slim.variables.global_step()
  File "/home/AIJ/tf_models/models/inception/bazel-bin/inception/imagenet_distributed_train.runfiles/inception/inception/slim/scopes.py", line 155, in func_with_args
    return func(*args, **current_args)
  File "/home/AIJ/tf_models/models/inception/bazel-bin/inception/imagenet_distributed_train.runfiles/inception/inception/slim/variables.py", line 244, in global_step
    trainable=False, collections=collections)
  File "/home/AIJ/tensorflow/_python_build/tensorflow/python/ops/variable_scope.py", line 988, in get_variable
    custom_getter=custom_getter)
  File "/home/AIJ/tensorflow/_python_build/tensorflow/python/ops/variable_scope.py", line 890, in get_variable
    custom_getter=custom_getter)
  File "/home/AIJ/tensorflow/_python_build/tensorflow/python/ops/variable_scope.py", line 348, in get_variable
    validate_shape=validate_shape)
  File "/home/AIJ/tensorflow/_python_build/tensorflow/python/ops/variable_scope.py", line 333, in _true_getter
    caching_device=caching_device, validate_shape=validate_shape)
  File "/home/AIJ/tensorflow/_python_build/tensorflow/python/ops/variable_scope.py", line 684, in _get_single_variable
    validate_shape=validate_shape)
  File "/home/AIJ/tensorflow/_python_build/tensorflow/python/ops/variables.py", line 226, in __init__
    expected_shape=expected_shape)
  File "/home/AIJ/tensorflow/_python_build/tensorflow/python/ops/variables.py", line 303, in _init_from_args
    initial_value(), name="initial_value", dtype=dtype)
  File "/home/AIJ/tensorflow/_python_build/tensorflow/python/ops/variable_scope.py", line 673, in <lambda>
    shape.as_list(), dtype=dtype, partition_info=partition_info)
TypeError: __init__() got multiple values for keyword argument 'dtype'

我认为问题是由于 api 在 slim 中某处不匹配。我使用的tensorflow版本是v1.0.0-alpha。谁能帮我解决这个问题?提前致谢!

问题已解决。这可能是由于 api 不匹配。解决方法是将inception/slim/variables.py中的243行改成initializer=tf.zeros_initializer().

有什么不对的地方请告诉我