marcopeix/time-series-analysis

Error while running TSMixer.ipynb

Opened this issue · 1 comments


TypeError Traceback (most recent call last)
Cell In[12], line 1
----> 1 model = build_model(
2 input_shape=(512, data_loader.n_feature),
3 pred_len=96,
4 n_block=8,
5 ff_dim=64,
6 target_slice=data_loader.target_slice
7 )

Cell In[11], line 12, in build_model(input_shape, pred_len, n_block, ff_dim, target_slice)
10 x = inputs # [Batch, Input Length, Channel]
11 for _ in range(n_block):
---> 12 x = res_block(x, ff_dim)
14 if target_slice:
15 x = x[:, :, target_slice]

Cell In[7], line 8, in res_block(inputs, ff_dim)
5 norm = layers.BatchNormalization
7 # Time mixing
----> 8 x = norm(axis=[-2, -1])(inputs)
9 x = tf.transpose(x, perm=[0, 2, 1]) # [Batch, Channel, Input Length]
10 x = layers.Dense(x.shape[-1], activation='relu')(x)

File ~/.local/lib/python3.10/site-packages/keras/src/layers/normalization/batch_normalization.py:144, in BatchNormalization.init(self, axis, momentum, epsilon, center, scale, beta_initializer, gamma_initializer, moving_mean_initializer, moving_variance_initializer, beta_regularizer, gamma_regularizer, beta_constraint, gamma_constraint, synchronized, **kwargs)
125 def init(
126 self,
127 axis=-1,
(...)
141 **kwargs,
142 ):
143 super().init(**kwargs)
--> 144 self.axis = int(axis)
146 if synchronized and backend.backend() != "tensorflow":
147 raise ValueError(
148 "Argument synchronized=True is only supported "
149 "with the TensorFlow backend."
150 )

TypeError: int() argument must be a string, a bytes-like object or a real number, not 'list'

I have the same problem