batch_x=[1,2,3,4,5,6,7,8,9]
indices = np.random.permutation(len(batch_x))
batch_x = batch_x[indices]
发生错误:TypeError:only integer scalar arrays can be converted to a scalar index

修改为:


indices = np.random.permutation(np.arange(len(batch_x)))
batch_x = np.array(batch_x)[indices]
batch_y = np.array(batch_y)[indices]
batch_label = np.array(batch_label)[indices]

相关文章:

  • 2021-04-08
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-01
  • 2022-12-23
猜你喜欢
  • 2021-12-03
  • 2022-01-05
  • 2021-12-27
  • 2021-06-30
相关资源
相似解决方案