我一直在玩内核大小和通道安排一段时间,但没有运气。我不完全确定如何计算 Conv2D 层的校正器参数,我不确定这些参数的更改会在多大程度上影响与论文中模型的相似性。
任何帮助将不胜感激。
我尝试根据文献中的设计构建的模型
input_shape = (4, 30, 180)
model = Sequential()
model.add(Convolution2D(32, (8, 8), strides=(4,4), activation='relu', input_shape=(4,30,180), data_format='channels_first'))
model.add(Activation('relu'))
model.add(Convolution2D(64, (4, 4), strides=(2, 2)))
model.add(Activation('relu'))
model.add(Convolution2D(64, (3, 3), strides=(1, 1)))
model.add(Activation('relu'))
model.add(Flatten())
model.add(Dense(512))
model.add(Activation('relu'))
model.add(Dense(2))
model.add(Activation('linear'))
我收到的错误消息
Traceback (most recent call last):
File "/Users/zacharyfrederick/opt/anaconda3/lib/python3.7/site-packages/tensorflow/python/framework/ops.py", line 1659, in _create_c_op
c_op = c_api.TF_FinishOperation(op_desc)
tensorflow.python.framework.errors_impl.InvalidArgumentError: Negative dimension size caused by subtracting 3 from 2 for 'conv2d_3/convolution' (op: 'Conv2D') with input shapes: [?,15,2,64], [3,3,64,64].
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "stock_env.py", line 101, in <module>
model.add(Convolution2D(64, (3, 3), strides=(1, 1)))
File "/Users/zacharyfrederick/opt/anaconda3/lib/python3.7/site-packages/keras/engine/sequential.py", line 181, in add
output_tensor = layer(self.outputs[0])
File "/Users/zacharyfrederick/opt/anaconda3/lib/python3.7/site-packages/keras/engine/base_layer.py", line 457, in __call__
output = self.call(inputs, **kwargs)
File "/Users/zacharyfrederick/opt/anaconda3/lib/python3.7/site-packages/keras/layers/convolutional.py", line 171, in call
dilation_rate=self.dilation_rate)
File "/Users/zacharyfrederick/opt/anaconda3/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py", line 3650, in conv2d
data_format=tf_data_format)
File "/Users/zacharyfrederick/opt/anaconda3/lib/python3.7/site-packages/tensorflow/python/ops/nn_ops.py", line 851, in convolution
狐的传说
不负相思意
相关分类