tsai icon indicating copy to clipboard operation
tsai copied to clipboard

Unable to run TSSequencerPlus

Open zmce2018 opened this issue 3 years ago • 0 comments

Hi, I am not able to run the TSSequencerPlus due the following problem:

X      - shape: [642876 samples x 47 features x 36 timesteps]  type: ndarray  dtype:float64  isnan: 0
y      - shape: (642876, 15)  type: ndarray  dtype:float64  isnan: 0
splits - n_splits: 2 shape: [559188, 83688]  overlap: False
use_token set to False as c_out == 1
epoch     train_loss  valid_loss  mae       smape     time    
Epoch 1/25 : |--------------------| 0.00% [0/1092 00:00<00:00]Traceback (most recent call last):

  File S:\timeseries\CNNpred(1)\multi_step_tsai.py:39 in <module>
    fcst.fit_one_cycle(25, 1)#lr_max.valley)

  File J:\anaconda3\envs\tsai\lib\site-packages\fastai\callback\schedule.py:116 in fit_one_cycle
    self.fit(n_epoch, cbs=ParamScheduler(scheds)+L(cbs), reset_opt=reset_opt, wd=wd)

  File J:\anaconda3\envs\tsai\lib\site-packages\fastai\learner.py:222 in fit
    self._with_events(self._do_fit, 'fit', CancelFitException, self._end_cleanup)

  File J:\anaconda3\envs\tsai\lib\site-packages\fastai\learner.py:164 in _with_events
    try: self(f'before_{event_type}');  f()

  File J:\anaconda3\envs\tsai\lib\site-packages\fastai\learner.py:213 in _do_fit
    self._with_events(self._do_epoch, 'epoch', CancelEpochException)

  File J:\anaconda3\envs\tsai\lib\site-packages\fastai\learner.py:164 in _with_events
    try: self(f'before_{event_type}');  f()

  File J:\anaconda3\envs\tsai\lib\site-packages\fastai\learner.py:207 in _do_epoch
    self._do_epoch_train()

  File J:\anaconda3\envs\tsai\lib\site-packages\fastai\learner.py:199 in _do_epoch_train
    self._with_events(self.all_batches, 'train', CancelTrainException)

  File J:\anaconda3\envs\tsai\lib\site-packages\fastai\learner.py:164 in _with_events
    try: self(f'before_{event_type}');  f()

  File J:\anaconda3\envs\tsai\lib\site-packages\fastai\learner.py:170 in all_batches
    for o in enumerate(self.dl): self.one_batch(*o)

  File J:\anaconda3\envs\tsai\lib\site-packages\tsai\learner.py:38 in one_batch
    self._with_events(self._do_one_batch, 'batch', CancelBatchException)

  File J:\anaconda3\envs\tsai\lib\site-packages\fastai\learner.py:164 in _with_events
    try: self(f'before_{event_type}');  f()

  File J:\anaconda3\envs\tsai\lib\site-packages\fastai\learner.py:173 in _do_one_batch
    self.pred = self.model(*self.xb)

  File J:\anaconda3\envs\tsai\lib\site-packages\torch\nn\modules\module.py:1110 in _call_impl
    return forward_call(*input, **kwargs)

  File J:\anaconda3\envs\tsai\lib\site-packages\torch\nn\modules\container.py:141 in forward
    input = module(input)

  File J:\anaconda3\envs\tsai\lib\site-packages\torch\nn\modules\module.py:1110 in _call_impl
    return forward_call(*input, **kwargs)

  File J:\anaconda3\envs\tsai\lib\site-packages\torch\nn\modules\container.py:141 in forward
    input = module(input)

  File J:\anaconda3\envs\tsai\lib\site-packages\torch\nn\modules\module.py:1110 in _call_impl
    return forward_call(*input, **kwargs)

  File J:\anaconda3\envs\tsai\lib\site-packages\fastai\layers.py:69 in Flatten
    return TensorBase(x.view(-1) if self.full else x.view(x.size(0), -1))

  File J:\anaconda3\envs\tsai\lib\site-packages\fastai\torch_core.py:341 in __torch_function__
    res = super().__torch_function__(func, types, args=args, kwargs=kwargs)

  File J:\anaconda3\envs\tsai\lib\site-packages\torch\_tensor.py:1142 in __torch_function__
    ret = func(*args, **kwargs)

RuntimeError: view size is not compatible with input tensor's size and stride (at least one dimension spans across two contiguous subspaces). Use .reshape(...) instead.

zmce2018 avatar Jun 20 '22 09:06 zmce2018