深度学习Course 2踩坑记

(本文原创于我自己原创的简书文章,时间为

2019.09.28 20:20:46   https://www.jianshu.com/p/9bfa63ec1201

 

Deep learning by Andrew NG在Course2的作业挺多坑的,可能是当时他布置作业时的环境比较旧,而现在搭建的Anaconda环境相对较新,有些方法已经不适用而造成的的。

先完成Regularizaion的作业,运行

\COURSE 2 Improving Deep Neural Networks Hyperparameter tuning, Regularization and Optimization\week5\Regularization\Regularization.ipynb

第一坑:

首先踩到的第一个坑是如下提示:

train_X, train_Y, test_X, test_Y = load_2D_dataset()

TypeError                                Traceback (most recent call last)

d:\Anaconda3\lib\site-packages\matplotlib\colors.py in to_rgba(c, alpha)

    173    try:

--> 174        rgba = _colors_full_map.cache[c, alpha]

    175    except (KeyError, TypeError):  # Not in cache, or unhashable.

TypeError: unhashable type: 'numpy.ndarray'

During handling of the above exception, another exception occurred:

ValueError                                Traceback (most recent call last)

d:\Anaconda3\lib\site-packages\matplotlib\axes\_axes.py in scatter(self, x, y, s, c, marker, cmap, norm, vmin, vmax, alpha, linewidths, verts, edgecolors, **kwargs)

  4231            try:  # Then is 'c' acceptable as PathCollection facecolors?

-> 4232                colors = mcolors.to_rgba_array(c)

  4233                n_elem = colors.shape[0]

d:\Anaconda3\lib\site-packages\matplotlib\colors.py in to_rgba_array(c, alpha)

    274    for i, cc in enumerate(c):

--> 275        result[i] = to_rgba(cc, alpha)

    276    return result

d:\Anaconda3\lib\site-packages\matplotlib\colors.py in to_rgba(c, alpha)

    175    except (KeyError, TypeError):  # Not in cache, or unhashable.

--> 176        rgba = _to_rgba_no_colorcycle(c, alpha)

    177        try:

d:\Anaconda3\lib\site-packages\matplotlib\colors.py in _to_rgba_no_c

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值