TypeError: concat() got an unexpected keyword argument 'axis'

来源:互联网 发布:mysql front 5.3 注册 编辑:程序博客网 时间:2024/05/20 23:07

在训练 tensorflow-0.11 时出现了 TypeError: concat() got an unexpected keyword argument 'axis'. 的错误

输出如下:

Traceback (most recent call last):  File "train_image_classifier-dist.py", line 656, in <module>    tf.app.run()  File "/home/docker/tensorflow-0.11/lib/python2.7/site-packages/tensorflow/python/platform/app.py", line 43, in run    sys.exit(main(sys.argv[:1] + flags_passthrough))  File "train_image_classifier-dist.py", line 512, in main    clones = model_deploy.create_clones(deploy_config, clone_fn, [batch_queue])  File "/home/docker/tensorflow-master/tensorflow_models/slim/deployment/model_deploy.py", line 195, in create_clones    outputs = model_fn(*args, **kwargs)  File "train_image_classifier-dist.py", line 496, in clone_fn    logits, end_points = network_fn(images)  File "/home/docker/tensorflow-master/tensorflow_models/slim/nets/nets_factory.py", line 105, in network_fn    return func(images, num_classes, is_training=is_training)  File "/home/docker/tensorflow-master/tensorflow_models/slim/nets/inception_v1.py", line 290, in inception_v1    net, end_points = inception_v1_base(inputs, scope=scope)  File "/home/docker/tensorflow-master/tensorflow_models/slim/nets/inception_v1.py", line 96, in inception_v1_base    net = tf.concat(axis=3, values=[branch_0, branch_1, branch_2, branch_3])TypeError: concat() got an unexpected keyword argument 'axis'

解决方法:
 将 inception_v1.py 中

net = tf.concat(axis=3, values=[branch_0, branch_1, branch_2, branch_3])
 改为 

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



0 0