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

GitHub 加速计划 / eleme / element
15
3
下载
A Vue.js 2.0 UI Toolkit for Web
最近提交(Master分支:3 个月前 )
c345bb45 1 年前
a07f3a59 * Update transition.md * Update table.md * Update transition.md * Update table.md * Update transition.md * Update table.md * Update table.md * Update transition.md * Update popover.md 1 年前
Logo

AtomGit 是由开放原子开源基金会联合 CSDN 等生态伙伴共同推出的新一代开源与人工智能协作平台。平台坚持“开放、中立、公益”的理念,把代码托管、模型共享、数据集托管、智能体开发体验和算力服务整合在一起,为开发者提供从开发、训练到部署的一站式体验。

更多推荐