zoukankan      html  css  js  c++  java
  • tensorflow报错error,tf.concat Expected int32, got list containing Tensors of type '_Message' instead

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

    我的代码是:

    image_seq = tf.concat(0, image_seq)
    然后就报错了:
    Backend TkAgg is interactive backend. Turning interactive mode on.
    Traceback (most recent call last):
      File "/home/work/Pycharm/pycharm-community-2017.1.4/helpers/pydev/pydevd.py", line 1591, in <module>
        globals = debugger.run(setup['file'], None, None, is_module)
      File "/home/work/Pycharm/pycharm-community-2017.1.4/helpers/pydev/pydevd.py", line 1018, in run
        pydev_imports.execfile(file, globals, locals)  # execute the script
      File "/home/tensorflow/models/research/video_prediction/grab_train_images.py", line 74, in <module>
        train_image_tensor = build_image_input()
      File "/home/tensorflow/models/research/video_prediction/grab_train_images.py", line 60, in build_image_input
        image_seq = tf.concat(0, image_seq)
      File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/array_ops.py", line 1061, in concat
        dtype=dtypes.int32).get_shape(
      File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 611, in convert_to_tensor
        as_ref=False)
      File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 676, in internal_convert_to_tensor
        ret = conversion_func(value, dtype=dtype, name=name, as_ref=as_ref)
      File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/constant_op.py", line 121, in _constant_tensor_conversion_function
        return constant(v, dtype=dtype, name=name)
      File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/constant_op.py", line 102, in constant
        tensor_util.make_tensor_proto(value, dtype=dtype, shape=shape, verify_shape=verify_shape))
      File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/tensor_util.py", line 376, in make_tensor_proto
        _AssertCompatible(values, dtype)
      File "/usr/local/lib/python2.7/dist-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.

    网上说是版本问题,要改为下面的,就好了:
    image_seq = tf.concat(image_seq, 0)
  • 相关阅读:
    ssh无密码登录 及集群分发脚本
    Hbase安装及客户端测试及笔记
    Zookeeper 的分布式安装部署及客户端测试
    搭建hadoop-完全分布式模式
    虚拟机的linux没有mac地址
    servlet-Listener 的复习
    纯servlet 达到spring的自动装配
    JDBC的复习 和工具类总结
    C#中的弱事件(Weak Events in C#)
    WeakReference(弱引用)
  • 原文地址:https://www.cnblogs.com/YouXiangLiThon/p/8567845.html
Copyright © 2011-2022 走看看