liyaguang / DCRNN

Implementation of Diffusion Convolutional Recurrent Neural Network in Tensorflow
MIT License
1.21k stars 400 forks source link

Label dimensions set to input dim #54

Closed k-pine closed 3 years ago

k-pine commented 4 years ago

I am implementing this algorithm for another scenario where I have a different number of input features (12) and output features (2). I was running into the error:

ValueError: Cannot feed value of shape (64, 7, 88, 2) for Tensor 'Train/DCRNN/labels:0', which has shape '(64, 7, 88, 12)'

I believe it can be fixed by changing input_dim in line 39 of dcrnn_model.py to output_dim (see code excerpt below). Everywhere else in the code the labels seem to have the output dimensions.

# Input (batch_size, timesteps, num_sensor, input_dim)
self._inputs = tf.placeholder(tf.float32, shape=(batch_size, seq_len, num_nodes, input_dim), name='inputs')
# Labels: (batch_size, timesteps, num_sensor, input_dim), same format with input except the temporal dimension.
self._labels = tf.placeholder(tf.float32, shape=(batch_size, horizon, num_nodes, **input_dim**), name='labels')
liyaguang commented 3 years ago

Yes, thanks for the information and sorry for missing the question. The current implementation assume the input_dim equals to the output dimension, and you can self._labels to have output_dim to accommodate the new scenario.