在学习莫烦教程中keras教程时,报错:TypeError: to_categorical() got an unexpected keyword argument 'nb_classes',代码如下

X_train = X_train.reshape(X_train.shape[0],-1) / 255 #normalize
X_test = X_test.reshape(X_test.shape[0],-1) / 255 #normalize
y_train = np_utils.to_categorical(y_train, nb_classes=10)
y_test = np_utils.to_categorical(y_test, nb_classes=10)

错误原因:keras版本问题,将nb_classes改为num_classes
参考keras文档:http://keras-cn.readthedocs.io/en/latest/utils/

TypeError: to_categorical() got an unexpected keyword argument 'nb_classes'的更多相关文章

  1. TypeError: parse() got an unexpected keyword argument 'transport_encoding'

    错误: TypeError: parse() got an unexpected keyword argument 'transport_encoding'You are using pip vers ...

  2. TypeError: __init__() got an unexpected keyword argument 't_command'

    python  .\manage.py migrate 报错如下 λ python .\manage.py migrateTraceback (most recent call last): File ...

  3. TypeError: while_loop() got an unexpected keyword argument 'maximum_iterations'

    错误: TypeError: while_loop() got an unexpected keyword argument 'maximum_iterations' 参照https://blog.c ...

  4. TypeError: pivot_table() got an unexpected keyword argument 'rows'

    利用Python进行数据分析>第二章,处理MovieLens 1M数据集,有句代码总是报错: mean_rating = data.pivot_table('rating', rows='tit ...

  5. TypeError: parse() got an unexpected keyword argument 'transport_encoding' 安装tensor后报错

    TypeError: parse() got an unexpected keyword argument 'transport_encoding' 巨蛋疼,出这个问题后,老夫真是醉了,mmp,最后在 ...

  6. Python pika, TypeError: exchange_declare() got an unexpected keyword argument 'type' 问题修复

    网上很多写法都是 type='fanout' 这样的.(这里是基于python=3.6版本, pika=0.13.0 版本) credentials = pika.PlainCredentials(' ...

  7. TypeError: _obtain_input_shape() got an unexpected keyword argument 'include_top'

    报错 Traceback (most recent call last): File "D:/PyCharm 5.0.3/WorkSpace/3.Keras/2.Application中五款 ...

  8. Django TypeError: render() got an unexpected keyword argument 'renderer'

    场景: Xadmin添加plugin 来源: 1. xadmin与DjangoUeditor的安装 (第3.3章节) 2. 增加富文本编辑器Ueditor (第14.7章节) 报错: Django T ...

  9. TypeError: __init__() got an unexpected keyword argument 'serialized_options'

    问题描述: TypeError: __init__() got an unexpected keyword argument 'serialized_options' File "objec ...

随机推荐

  1. virtualBox linux操作系统centos 挂载光盘

    virtualBox虚拟机linux centos 挂载光盘 第一步: 放入光盘 第二步: 挂载光驱 (/dev/cdrom) 1) 创建挂载点 mkdir /mnt/media 2) 挂载 moun ...

  2. [PLC]ST语言三:OUT/OUT_T/OUT_C/OUT_C-C32

    一:OUT/OUT_T/OUT_C/OUT_C-C32               说明:简单的顺控指令不做其他说明. 控制要求:无 编程梯形图: 结构化编程ST语言: (*OUT(EN,D);*) ...

  3. Jmeter 数据库配置池设置IP为参数

    我在网上查了很多资料,发现jmter链接数据库的URL都是设置成固定值的.没有参数化. 当我需要使用配置文件链接不同服务器上的数据库的时候,发现无法实现. 原因在于:jmeter的元件执行优先级是配置 ...

  4. python游戏编程——乌龟和鱼类场景编程

    综合举例: 游戏编程:按以下要求定义一个乌龟类和鱼类并尝试编写游戏. O    假设游戏场景为范围(x, y)为0<=x<=10,0<=y<=10 ·       游戏生成1只 ...

  5. 【SIKIA计划】_11_Unity动画插件-DOTween笔记

    [插值移动]using DG.Tweening;public class GetStart:MomoBehaviour{ public Vector3 myValue = new Vector3(0, ...

  6. ios有些机型input和fixed导致的页面错位问题

    _fixIosInputH () { let [timeout, beforeTop] = [null, 0] $('input, textarea').on('focus', () => { ...

  7. 微软Word制作自己的模板

    我们在用Word的时候,很多时候需要一定的格式. 这个时候,*.dotx文件出场了!它将带给我们自己的模板. 步骤: 首先,新建一个文档,选择空白文档: 图片大就大吧,不要在意这些细节. 编辑一下,保 ...

  8. XML学习(一)

    实体引用 在 XML 中,一些字符拥有特殊的意义. 如果您把字符 "<" 放在 XML 元素中,会发生错误,这是因为解析器会把它当作新元素的开始. 这样会产生 XML 错误: ...

  9. python编辑修改haproxy配置文件--文件基础操作

    一.需求分析 有查询,删除,添加的功能 查询功能:查询则打印查询内容,如果不存在也要打印相应的信息 删除功能:查询到要删除内容则删除,打印信息. 添加功能:同上. 二.流程图 三.代码实现 本程序主要 ...

  10. 深入理解List集合框架底层原理的实现

    前言: 此篇文章讲解ArrayList和LinkedList底层实现原理.for和foreach遍历集合哪个效率会更高一些! 讲讲什么是集合框架?集合框架是为表示和操作集合而规定的一种统一的标准的体系 ...