State-Frequency-Memory-stock-prediction icon indicating copy to clipboard operation
State-Frequency-Memory-stock-prediction copied to clipboard

error during model build

Open pbezz1 opened this issue 5 years ago • 2 comments

I set up the environment with the right versions of keras and theano and after fixing some minor issues I am getting the below error when running the command "python test.py --step=1" and I have no idea how to fix it ..

File "test.py", line 50, in model = build.build_model([1, hidden_dim, 1], freq, 0.01) File "..\test\build.py", line 55, in build_model return_sequences=True)) File "C:\Anaconda3\envs\MyEnv\lib\site-packages\keras\models.py", line 107, in add layer.create_input_layer(batch_input_shape, input_dtype) File "C:\Anaconda3\envs\MyEnv\lib\site-packages\keras\engine\topology.py", line 341, in create_input_layer self(x) File "C:\Anaconda3\envs\MyEnv\lib\site-packages\keras\engine\topology.py", line 485, in call self.add_inbound_node(inbound_layers, node_indices, tensor_indices) File "C:\Anaconda3\envs\MyEnv\lib\site-packages\keras\engine\topology.py", line 543, in add_inbound_node Node.create_node(self, inbound_layers, node_indices, tensor_indices) File "C:\Anaconda3\envs\MyEnv\lib\site-packages\keras\engine\topology.py", line 148, in create_node output_tensors = to_list(outbound_layer.call(input_tensors[0], mask=input_masks[0])) File "C:\Anaconda3\envs\MyEnv\lib\site-packages\keras\layers\recurrent.py", line 213, in call ': ' + str(input_shape)) Exception: When using TensorFlow, you should define explicitly the number of timesteps of your sequences. If your first layer is an Embedding, make sure to pass it an "input_length" argument. Otherwise, make sure the first layer has an "input_shape" or "batch_input_shape" argument, including the time axis. Found input shape at layer itosfm_1: (None, None, 1)

Has anybody come across this error please? and how did you manage to fix it?

Any help is appreciate because I cannot progress any further..

Thanks

pbezz1 avatar Aug 25 '19 07:08 pbezz1

using Theano as the backend of Keras instead of tensorflow

tengxiao14 avatar Sep 08 '19 18:09 tengxiao14

KERAS_BACKEND=theano python train.py

Waterkin avatar Sep 07 '22 07:09 Waterkin