簡體   English   中英

AxisError:軸 1 超出維度 1 數組的范圍

[英]AxisError: axis 1 is out of bounds for array of dimension 1

在此處輸入圖像描述

這是我的代碼:

config = Config(mode='conv')

    if config.mode == 'conv':
        X, y = build_rand_feat()
        y_flat = np.argmax(y, axis=1)
        model=get_conv_model()

    elif config.mode == 'time':
        X, y = build_rand_feat()
        y_flat = np.argmax(y,axis=1)
        input_shape = (X.shape[1], X.shape[2])
        model = get_recurrent_model()

請幫我解決這個問題。

只需更改為軸 0,因為只有一維。 祝你好運!

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM