TypeError: Expected int32, got list containing Tensors of type '_Message' instead.
来源:互联网 发布:mdict for mac 编辑:程序博客网 时间:2024/06/05 03:41
在训练 tensorflow-0.11 时出现了 TypeError: Expected int32, got list containing Tensors of type '_Message' instead. 的错误
输出如下:
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_v3.py", line 576, in inception_v3 depth_multiplier=depth_multiplier) File "/home/docker/tensorflow-master/tensorflow_models/slim/nets/inception_v3.py", line 181, in inception_v3_base net = array_ops.concat([branch_0, branch_1, branch_2, branch_3], 3) File "/home/docker/tensorflow-0.11/lib/python2.7/site-packages/tensorflow/python/ops/array_ops.py", line 1121, in concat dtype=dtypes.int32).get_shape( File "/home/docker/tensorflow-0.11/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 645, in convert_to_tensor as_ref=False) File "/home/docker/tensorflow-0.11/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 710, in internal_convert_to_tensor ret = conversion_func(value, dtype=dtype, name=name, as_ref=as_ref) File "/home/docker/tensorflow-0.11/lib/python2.7/site-packages/tensorflow/python/framework/constant_op.py", line 176, in _constant_tensor_conversion_function return constant(v, dtype=dtype, name=name) File "/home/docker/tensorflow-0.11/lib/python2.7/site-packages/tensorflow/python/framework/constant_op.py", line 165, in constant tensor_util.make_tensor_proto(value, dtype=dtype, shape=shape, verify_shape=verify_shape)) File "/home/docker/tensorflow-0.11/lib/python2.7/site-packages/tensorflow/python/framework/tensor_util.py", line 367, in make_tensor_proto _AssertCompatible(values, dtype) File "/home/docker/tensorflow-0.11/lib/python2.7/site-packages/tensorflow/python/framework/tensor_util.py", line 302, in _AssertCompatible (dtype.name, repr(mismatch), type(mismatch).__name__))TypeError: Expected int32, got list containing Tensors of type '_Message' instead.
这是因为版本不兼容的问题,我用的脚本是适用于tensorflow 1.0的
解决方法:
将inception_v3.py 中的
net = array_ops.concat([branch_0, branch_1, branch_2, branch_3], 3)
均改为
net = array_ops.concat(3, [branch_0, branch_1, branch_2, branch_3])
解决 ^^
1 0
- Expected int32, got list containing Tensors of type '_Message' instead.
- TypeError: Expected int32, got list containing Tensors of type '_Message' instead.
- TypeError: Expected int32, got list containing Tensors of type '_Message' instead.解决方法
- TypeError: Expected int32, got list containing Tensors of type '_Message' instead.
- TypeError: Expected int32, got list containing Tensors of type '_Message' instead.
- TypeError: Expected int32, got list containing Tensors of type ‘_Message’ instead.
- tf.cocat Expected int32, got list containing Tensors of type '_Message' instead.
- TypeError: List of Tensors when single Tensor expected
- TypeError: string argument expected, got 'bytes'
- TypeError: Input 'b' of 'MatMul' Op has type float32 that does not match type int32 of argument 'a'.
- TypeError: unhashable type: 'list'
- TypeError: unhashable type: 'list'
- Android开发报错:GoogleApiClient.isConnected()' was expected to be of type interface but instead was ...
- ValueError: Expected 2D array, got 1D array instead:
- TypeError: Input 'split_dim' of 'Split' Op has type float32 that does not match expected type of int
- python3 pycurl 出现 TypeError: string argument expected, got 'bytes' 解决方案
- Caused by: org.hibernate.TypeMismatchException: Provided id of the wrong type. Expected: class java.lang.Integer, got class [Lja
- Android插件中使用EventBus出现java.lang.IllegalArgumentException: Expected receiver of type xxx, but got xx
- bzoj 3924: [Zjoi2015]幻想乡战略游戏 动态树分治
- MyEclipse查看jar包源代码乱码问题解决
- hdu4352——XHXJ's LIS(数位DP+状压)
- Python+Selenium框架设计篇之9-unittest执行脚本方法之makeSuite()
- android动画实现一张图自动旋转、可随时暂停、停止和重置,类似秒表指针旋转动画
- TypeError: Expected int32, got list containing Tensors of type '_Message' instead.
- 2017CCCC决赛 L1-6. 整除光棍
- 初识进程
- 微信支付小记
- python学习笔记-eval
- MD5加密
- B+树
- 湖北民族学院oj 1780 (BFS) 之 马的移动
- iOS swift实现图片不重复保存至相册