TypeError: List of Tensors when single Tensor expected - when using const with tf.random_normal

tf.constant需要用numpy array进行初始化,不能用tf自己的函数返回值,也就是tensor进行初始化赋值。

import tensorflow as tf

import numpy as np

arr=np.array([[1,2,3],[4,5,6]])

tf_ct=tf.constant(arr)

扫码关注

实用AI客栈

获取最新AI资讯与实战案例

小编微信号 : langu86

posted @ 2022-11-13 22:37  dlhl  阅读(95)  评论(0)    收藏  举报