校正形状以供给OpenAI Gym张量

时间:2018-09-25 15:20:20

标签: python tensorflow keras recurrent-neural-network openai-gym

我正在一个健身房环境中工作,该环境将收到一个具有67列(功能)和很多行的csv文件,batch_size为10,这意味着它将在每个步骤中读取10行csv文件。

我收到以下错误:

ValueError: Cannot feed value of shape (1, 67) for Tensor 'input_1:0', which has shape '(?, 10, 67)'

当我尝试提供此模型时:

def make_model(env): 
    state = layers.Input(shape=(10, 67)) 
    conv1 = layers.Conv1D(filters=2, kernel_size=1)(state) 
    conv1 = layers.Activation('relu')(conv1) 
    conv_flat = layers.Flatten()(conv1) 
    feature = layers.Dense(512)(conv_flat) 
    feature = layers.Activation('relu')(feature) 

    # actor (policy) and critic (value) streams 
    logits_init = initializers.RandomNormal(stddev=1e-3) 
    logits = layers.Dense(4, kernel_initializer=logits_init)(feature) 
    value = layers.Dense(4)(feature) 
    return models.Model(inputs=state, outputs=[logits, value])

我知道此结构有问题,但在idk那里,任何帮助将不胜感激:)

有用的链接:

我正在尝试遵循以下健身环境结构:https://github.com/spring01/drlbox/blob/master/examples/breakout_acer.py

这是完整的代码: https://www.codepile.net/pile/ngrvQ0gz

0 个答案:

没有答案