我有一个旧的Keras模型文件,它工作得很好。但是,当我试图在tensorflow==1.13.1
中加载它时,会收到大量警告:
import tensorflow as tf
model = tf.keras.models.load_model("best.h5")
WARNING:tensorflow:From .pyenv/versions/3.6.0/lib/python3.6/site-packages/tensorflow/python/ops/resource_variable_ops.py:435: colocate_with (from tensorflow.python.framework.ops) is deprecated and will be removed in a future version. Instructions for updating: Colocations handled automatically by placer.
WARNING:tensorflow:From .pyenv/versions/3.6.0/lib/python3.6/site-packages/tensorflow/python/ops/math_ops.py:3066: to_int32 (from tensorflow.python.ops.math_ops) is deprecated and will be removed in a future version. Instructions for updating: Use tf.cast instead.
假设我不想重新训练模型,如何更新它以避免出现这些错误?如果需要,原始网络(简单的1D covnet)如下:
^{pr2}$
这些不是错误,它们与tensorflow中的内部Keras实现有关,除了等待
tf.keras
更新它们的实现和不使用已弃用的函数之外,没有什么可以做的。在相关问题 更多 >
编程相关推荐