tf2.0在模型的call()中调用tf.keras.layers.embedding,出错 tf.function-decorated function tried to create variables on non-first call

解决方法:

不要再call中调用tf.keras的接口,使其在模型定义的init()方法中定义。

`def __init__():

self.embed_seq = tf.keras.layers.Embedding(8874, input_length=self.playlength, output_dim=32)

def call():

y = embed_seq(x)

`

tf.function-decorated function tried to create variables on non-first call相关推荐

  1. ValueError: Creating variables on a non-first call to a function decorated with tf.function.解决方法

    参考Creating variables on a non-first call to a function decorated with tf.function.解决方法!_时时勤拂拭.的博客-CS ...

  2. Creating variables on a non-first call to a function decorated with tf.function.解决方法!

    Creating variables on a non-first call to a function decorated with tf.function.解决方法! Creating varia ...

  3. Bug之ValueError: tf.function-decorated function tried to create variables on non-first call.

    问题描述: tensorflow2.1 搭建模型时报以下错误 ValueError: tf.function-decorated function tried to create variables ...

  4. ValueError: tf.function-decorated function tried to create variables on non-first call

    问题: tf 1x 的代码迁移到 tf 2x时出现错误: ValueError: tf.function-decorated function tried to create variables on ...

  5. ValueError: tf.function-decorated function tried to create variables on non-first call.

    问题:ValueError: tf.function-decorated function tried to create variables on non-first call. 解决方案-当您尝试 ...

  6. Error-tf.function-decorated function tried to create variables on non-first call

    ValueError: tf.function-decorated function tried to create variables on non-first call 在tensorflow2中 ...

  7. function java_java.util.function之function

    Function类包含四种方法,其中一个抽象方法apply(),两个default方法andThen()和compose(),以及一个静态方法identity(). 实例化Function的时候需要实 ...

  8. ( function(){…} )()和( function (){…} () )是两种立即执行函数

    函数声明:function fnName () {-}; 函数表达式 var fnName = function () {-}; 匿名函数:function () {}; fnName(); func ...

  9. js立即执行函数: (function ( ){...})( ) 与 (function ( ){...}( ))

    ( function(){-} )() ( function (){-} () ) 是两种javascript立即执行函数的常见写法,最初我以为是一个括号包裹匿名函数,再在后面加个括号调用函数,最后达 ...

最新文章

  1. 为x86 CPU自动调度神经网络
  2. R语言optimize函数一维优化实战
  3. 互联网人才大迁徙:新基建人均月薪17895元,核心人才缺口420万
  4. String与NSString关系
  5. TypeScript 发布 3.4 首个 RC 预览版
  6. 核能力将定手机浏览器HTML5之争成败
  7. 分析一段H264视频数据
  8. 5 点击图换下一张_如何制作一张高点击率主图
  9. 面向对象软件设计原则(一) —— 引子
  10. 11.排序算法_1_快速排序
  11. php设计模式总结-单件模式
  12. idea 搜索快捷键
  13. 最好的UI/UE设计资源网站推荐-免费的头像库
  14. 简单爬虫 爬取百度图片并批量重命名
  15. 路演 - roadshow
  16. 卸载 Mac 默认的 Xcode 附带的 git
  17. 群晖NAS搭建WebDav服务,并内网穿透实现公网访问
  18. 【文献学习】热电偶信号调理、IOT接入
  19. mysql 查找具体sql执行性能
  20. scala之隐式转换

热门文章

  1. 手把手教你在Windows下使用MinGW编译libav(参考libx264的编入)
  2. 上网需要在计算机上安装数据库管理软件吗,上网需要在计算机上安装什么软件...
  3. PHP编译为静态库,makefile生成静态库和动态库
  4. python b站日排行榜_bilibili弹幕网视频日排行榜数据分析
  5. 旧键盘打字 两数之和
  6. DDD 实战 (2):看看代码结构长啥样(值得收藏)
  7. 经纬度转高斯投影坐标(xy平面坐标)
  8. EOF和scanf函数
  9. jquery实现图片随机切换、抽奖功能
  10. mexFunction