TypeError: Expected int32, got list containing Tensors of type '_Message' instead.
来源:互联网 发布:c语言写学生管理系统 编辑:程序博客网 时间:2024/06/06 00:08
代码:
def convolve(img, W):
# The W matrix is only 2D# But conv2d will need a tensor which is 4d:
# height x width x n_input x n_output
if len(W.get_shape()) == 2:
dims = W.get_shape().as_list() + [1, 1]
W = tf.reshape(W, dims)
if len(img.get_shape()) == 2:
# num x height x width x channels
dims = [1] + img.get_shape().as_list() + [1]
img = tf.reshape(img, dims)
elif len(img.get_shape()) == 3:
dims = [1] + img.get_shape().as_list()
img = tf.reshape(img, dims)
# if the image is 3 channels, then our convolution
# kernel needs to be repeated for each input channel
W = tf.concat(2, [W, W, W])
# Stride is how many values to skip for the dimensions of
# num, height, width, channels
convolved = tf.nn.conv2d(img, W,
strides=[1, 1, 1, 1], padding='SAME')
return convolved
x = tf.placeholder(tf.float32, shape=img.shape)
out = convolve(x, gabor())
报错:
TypeError: Expected int32, got list containing Tensors of type '_Message' instead.
解决办法:
tf.concat([W, W, W],2)
阅读全文
0 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
- 5322. 【GDOI2017模拟8.21】小朋友 状压dp
- 笔记--垃圾收集器与内存分配策略
- 程序人生()
- Java Base
- python——flask如何截获所有访问,以及before_request、after_request修饰器
- TypeError: Expected int32, got list containing Tensors of type '_Message' instead.
- beta分布
- 序列化
- 在TensorFlow中实现文本分类的卷积神经网络
- 欢迎使用CSDN-markdown编辑器
- swiper在微信服务号中不能滑动
- 安卓录屏
- Java访问控制修饰符与继承
- Android进阶#(1/12)Android的构成基石——四大组件_ContentProvider(外共享数据)