嗨,我试图加载在Keras中创建的keras模型:2.2.4版本,并且我试图加载以下指定版本。
我试图按如下所述加载模型。
import tensorflow as tf
classifierLoad = tf.keras.models.load_model('w.hdf5')
而加载它显示这样的错误。
/usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/dtypes.py:526:FutureWarning:不赞成将(type,1)或'1type'作为type的同义词传递;在numpy的未来版本中,它将被理解为(type,(1,))/'(1,)type'。_np_qint8 = np.dtype([[“” qint8“,np.int8,1)])/usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/dtypes.py:527:FutureWarning:传递(type,1)或'1type'作为type的同义词已被弃用;在numpy的未来版本中,它将被理解为(type,(1,))/'(1,)type'。_np_quint8 = np.dtype([[“” quint8“,np.uint8,1)])/usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/dtypes.py:528:FutureWarning:传递(type,1)或'1type'作为type的同义词已被弃用;在numpy的未来版本中,它会被理解为(type,(1,))/'(1,)type'。_np_qint16 = np.dtype([[“” qint16“,np.int16,1)])/usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/dtypes.py:529:FutureWarning:传递(type,1)或'1type'作为type的同义词已被弃用;在numpy的未来版本中,它将被理解为(type,(1,))/'(1,)type'。_np_quint16 = np.dtype([[“” quint16“,np.uint16,1)])/usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/dtypes.py:530:FutureWarning:Passing (type,1)或'1type'作为type的同义词已被弃用;在numpy的未来版本中,它将被理解为(type,(1,))/'(1,)type'。_np_qint32 = np.dtype([(“ qint32”,np.int32,1)])/usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/dtypes.py:535:FutureWarning:不建议使用(type,1)或'1type'作为type的同义词;在numpy的未来版本中,它将被理解为(type,(1,))/'(1,)type'。np_resource = np.dtype([(“ resource”,np.ubyte,1)])警告:tensorflow:来自/usr/local/lib/python3.6/dist-packages/tensorflow/python/ops/resource_variable_ops.py: 435:colocate_with(来自tensorflow.python.framework.ops)已被弃用,并将在以后的版本中删除。更新说明:托管服务器自动处理的托管。2020-02-20 18:17:45.291135:W tensorflow / core / platform / profile_utils / cpu_utils.cc:98]无法在/ proc / cpuinfo中找到Bogomips;无法确定CPU频率2020-02-20 18:17:45.292283:我tensorflow / compiler / xla / service / service.cc:161] XLA服务0x27584260在平台主机上执行计算。设备:2020-02-20 18:17:45.292367:我tensorflow / compiler / xla / service / service.cc:168] StreamExecutor设备(0):,2020-02-20 18:17:45.438308:我tensorflow / stream_executor / cuda / cuda_gpu_executor.cc:965] ARM64不支持NUMA-返回NUMA节点零2020-02-20 18:17:45.438696:我tensorflow / compiler / xla / service / service.cc:161] XLA服务0x237da820在平台CUDA上执行计算。设备:2020-02-20 18:17:45.438755:I tensorflow / compiler / xla / service / service.cc:168] StreamExecutor设备(0):NVIDIA Tegra X1,计算能力5.3 2020-02-20 18:17: 45.439077:I tensorflow / core / common_runtime / gpu / gpu_device.cc:1433]找到了具有属性的设备0:名称:NVIDIA Tegra X1 major:5 minor:3 memoryClockRate(GHz):0.9216 pciBusID:0000:00:00.0 totalMemory:3.87 GiB freeMemory:569.37MiB 2020-02-20 18:17:45.439136:我tensorflow / core / common_runtime / gpu / gpu_device.cc:初始化超级(Adam,自我)。init(** kwargs)文件“ /usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/optimizers.py”,第68行,init '传递给优化器:'+ str(k) )TypeError:传递给优化程序的意外关键字参数:name
任何建议
您的问题来自于您混合使用纯文本keras
和tensorflow.keras
版本的事实。
它们不兼容。将来,如果要训练模型,请确保先训练模型,tensorflow.keras
然后再从tensorflow.keras
测试时加载。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句