ValueError: setting an array element with a sequence

ValueError: setting an array element with a sequence问题主要有几种以下的情况:

  1. 输入到模型里的数据没严格转换成 np.arry()形式,
  2. 矩阵没对齐,个别行成员数量与其他不一致,不如0的缺省等。
  3. 数据dtype不对或者说不一致,应该统一成 np.float64, int或者其他。

feeds = {
    sbl.input_x1: x1_train_batch,
    sbl.input_x2: x2_train_batch,
    sbl.input_y: y_train_batch,
    sbl.dropout_keep_prob: FLAGS.dropout_keep_prob
}

字典中,x1_train_batchx2_train_batch 的维度不一样

又如:

 np.array([1,2,3,[4,5,6]])
 ValueError: setting an array element with a sequence.
  • 参考文献

ValueError: setting an array element with a sequence问题解决思路_人工智能_Poo_Chai的博客-CSDN博客
https://blog.csdn.net/Poo_Chai/article/details/91040938

ValueError: setting an array element with a sequence._Python_qq_24140919的博客-CSDN博客
https://blog.csdn.net/qq_24140919/article/details/88851855

ValueError: setting an array element with a sequence. tensorflow numpy_人工智能_xgli的博客-CSDN博客
https://blog.csdn.net/lxg0807/article/details/53883671

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章