Planar+data+classification+with+one+hidden+layer+v5

报一个错误:

ValueError: c of shape (1, 400) not acceptable as a color sequence for x with size 400, y with size 400

吴恩达 Deep Learning Lesson 1 Week 2 作业报错解决

找到调用函数的地方,将 c=y改成:

两种解决均可:

 1. c=Y.reshape(400)

 2. c= np.squeeze(y)

吴恩达 Deep Learning Lesson 1 Week 2 作业报错解决

注意:如果你是用的jupyter notebook做的,在练习的页面一定记得点一下kernel下面的那个刷新图标,也就是重启内核,还记得把上面的导包命令重新执行一下,不然还是会报这个错误。

相关文章:

  • 2021-07-31
  • 2021-08-04
  • 2021-09-18
  • 2021-09-04
  • 2021-04-09
  • 2021-09-23
  • 2021-10-19
  • 2021-09-23
猜你喜欢
  • 2021-05-14
  • 2021-08-06
  • 2022-12-23
  • 2022-01-01
  • 2021-09-17
  • 2021-07-10
  • 2022-01-22
相关资源
相似解决方案