小编Mei*_*b12的帖子

ValueError: ('无法识别的关键字参数:', dict_keys(['ragged'])) 加载 keras 模型时

我正在尝试使用下面的代码片段加载 keras 模型:

    from tensorflow import keras
    from PIL import Image, ImageOps
    import numpy as np

    # Disable scientific notation for clarity
    np.set_printoptions(suppress=True)

    # Load the model
    model = keras.models.load_model('keras_model.h5')

    # Create the array of the right shape to feed into the keras model
    # The 'length' or number of images you can put into the array is
    # determined by the first position in the shape tuple, in this case 1.
    data = np.ndarray(shape=(1, 224, 224, 3), dtype=np.float32)

    # …
Run Code Online (Sandbox Code Playgroud)

python keras tensorflow

6
推荐指数
1
解决办法
2万
查看次数

标签 统计

keras ×1

python ×1

tensorflow ×1