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中如下保存模型的总是报错,很是头疼:
model.save(weight_file)
错误的位置定格在:
out_data = tf.keras.layers.Conv2D(filters, [3,3])(concat_data)
最终找到原因,需要先在__init__函数体中定义好,才能在call中进行调用:
def __init__(self,**kwargs):super(Up_sampling, self).__init__(**kwargs)self.Conv2D_256 = tf.keras.layers.Conv2D(256, [3, 3])def call(self, input,filters):if filters==256:out_data = self.Conv2D_256(input)
这样就很好的解决问题了,错误消失!
Error-tf.function-decorated function tried to create variables on non-first call相关推荐
- 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 ...
- 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 ...
- 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 ...
- 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 ...
- tf.function-decorated function tried to create variables on non-first call
tf2.0在模型的call()中调用tf.keras.layers.embedding,出错 tf.function-decorated function tried to create variab ...
- 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. 解决方案-当您尝试 ...
- Mysql ERROR 1418 (HY000): This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA
ERROR 1418 (HY000): This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declar ...
- yocto编译错误- Error executing a python function in exec_python_func() autogenerated
yocto编译错误 主要错误信息 **ERROR: fsl-image-validation-imx-1.0-r0 do_rootfs: Error executing a python functi ...
- error C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. 的解决方法
vs2013编译出错信息:错误 1 error C4996: 'fopen': This function or variable may be unsafe. Consider usin ...
最新文章
- 照片换色 使用Python 或者 java
- C++回调函数用法(zz)
- boost::ptr_list相关的测试程序
- mysql权限说法正确的是,【多选题】下面关于修改 MySQL 配置的说法中,正确的是...
- ZOJ The Sum of Unitary Totient(min_25 筛)
- 关于微信分享的一些心得之recommend.js(直接复制就行)
- sonarqube 启动不了,异常提示:远程主机强迫关闭了一个现有的连接
- 用ShopEx网上开店之安装Zend插件[2]
- oracle多表查询while,oracle while的用法示例分享
- 存储成本降低80%,“大智慧”的选择
- Java中的包扫描(工具)
- 林森---博客园之二,对《闭包》的个人见解!希望能帮到不理解闭包的同学们!...
- pdfdom将pdf转成html,使用pdfdom将pdf转为html(示例代码)
- 静态创意和动态创意_8种独特且价格合理的名片的创意
- td可编辑(html标签可编辑)
- 度娘果然毫无节操,纯粹就是order by 广告费 desc
- 【解决方案】摄像机户外直播能在哪些地方运用?团建/项目启动会/户外婚礼等户外直播方案介绍
- signature=161034cb9eebb9b66e71be6081528fe7,Alternative Semantics for Verdi
- Java程序员应该学习的10件清单
- html文件导入excel 出现乱码,win7系统txt导入excel出现中文乱码的解决方法