简体   繁体   中英

AxisError: axis 1 is out of bounds for array of dimension 1

enter image description here

This is my code:

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()

Please help me to fix this.

simply change to axis 0, as has only one dimension. Good Luck!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM