Numpy tensorflow ValueError:使用序列设置数组元素

Numpy tensorflow ValueError:使用序列设置数组元素,numpy,tensorflow,Numpy,Tensorflow,我的数据格式如下: 我用这些数据来输入tensorflow代码: user_batch = tf.placeholder(tf.int32, shape=[None], name="id_user") item_batch = tf.placeholder(tf.int32, shape=[None], name="id_item") tag_batch = tf.placeholder(tf.int32,shape=[3,None],name ="id_tag") rate_batch =

我的数据格式如下:

我用这些数据来输入tensorflow代码:

user_batch = tf.placeholder(tf.int32, shape=[None], name="id_user")
item_batch = tf.placeholder(tf.int32, shape=[None], name="id_item")
tag_batch = tf.placeholder(tf.int32,shape=[3,None],name ="id_tag")
rate_batch = tf.placeholder(tf.float32, shape=[None])

那么它有一个错误:

文件“/home/ljh/NCF_TF/GMF.py”,第125行,GMF格式 速率(批量:速率}) 文件“/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py”, 第766行,运行中 运行_元数据_ptr) 文件“/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py”, 第937行,正在运行 np\u val=np.asarray(subfeed\u val,dtype=subfeed\u dtype) 文件“/usr/local/lib/python2.7/dist-packages/numpy/core/numeric.py”,第行 531,在asarray 返回数组(a,dtype,copy=False,order=order)值错误:使用序列设置数组元素


问题的可能重复项可能是
tag\u batch=tf.placeholder(tf.int32,shape=[3,None],name=“id\u tag”)
,其中它可能希望形状为
[None,3]
,可能会使用
用户、项目、标记、费率的类型和形状的打印。我已经创建了形状,并确认所有变量的形状是正确的,但它仍然具有相同的形状problem@PietroTortella
for i in range(EPOCH_MAX * samples_per_batch):
    users, items,tags,rates = next(iter_train)            
    _, pred_batch = sess.run([train_op, infer], feed_dict={user_batch: users,
                                                           item_batch: items,
                                                           tag_batch:tags,
                                                           rate_batch: rates})`