Code Monkey home page Code Monkey logo

Comments (6)

LiangcaiSu avatar LiangcaiSu commented on September 22, 2024 1

I followed your steps, but still have problems. Here are more details.
Environment: pytorch 1.11.0 py3.7_cuda11.3_cudnn8.2.0_0
Error Report:

  File "/data/data/xxxx/ST/src/easytorch/launcher/launcher.py", line 93, in launch_training
    train_dist(cfg)
  File "/data/data/xxxx/ST/src/easytorch/launcher/launcher.py", line 56, in training_func
    raise e
  File "/data/data/xxxx/ST/src/easytorch/launcher/launcher.py", line 52, in training_func
    runner.train(cfg)
  File "/data/data/xxxx/ST/src/easytorch/core/runner.py", line 351, in train
    loss = self.train_iters(epoch, iter_index, data)
  File "/data/data/xxxx/ST/src/basicts/runners/short_mts_runner.py", line 186, in train_iters
    prediction, real_value = self.forward(data=data, epoch=epoch, iter_num=iter_num, train=True)
  File "/data/data/xxxx/ST/src/basicts/runners/GraphWaveNet_runner.py", line 54, in forward
    prediction_data = self.model(history_data=history_data)     # B, L, N, C
  File "/data/data/xxxx/anaconda3/envs/torch/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1110, in _call_impl
    return forward_call(*input, **kwargs)
  File "/data/data/xxxx/ST/src/basicts/archs/GraphWaveNet_arch/GraphWaveNet_arch.py", line 188, in forward
    gate = self.gate_convs[i](residual)
  File "/data/data/xxxx/anaconda3/envs/torch/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1110, in _call_impl
    return forward_call(*input, **kwargs)
  File "/data/data/xxxx/anaconda3/envs/torch/lib/python3.7/site-packages/torch/nn/modules/conv.py", line 302, in forward
    return self._conv_forward(input, self.weight, self.bias)
  File "/data/data/xxxx/anaconda3/envs/torch/lib/python3.7/site-packages/torch/nn/modules/conv.py", line 299, in _conv_forward
    self.padding, self.dilation, self.groups)
RuntimeError: Expected 2D (unbatched) or 3D (batched) input to conv1d, but got input of size: [64, 32, 358, 13]

*: "xxxx" is my name, please ignore it.

Also, I check the code, and theoretically there should be this error.
nn.Conv1d expects a 3-dimensional input in the shape [batch_size, channels, seq_len] while you are using a 4-dimensional input with shape [batch_size, channels, num_nodes, time_steps].

Btw, could you provide your email address that you use regularly?

from basicts.

zezhishao avatar zezhishao commented on September 22, 2024 1

Hi @Ethan1X ~ Thanks for your ideas, and this issue is indeed caused by the PyTorch version.
Although BasicTS itself does not have many requirements on the Pytorch version, some baselines may encounter compatibility issues in higher versions.
I would recommend you use versions 1.10.0 or 1.9.1, which have been tested.

from basicts.

LiangcaiSu avatar LiangcaiSu commented on September 22, 2024

Thanks to the author for the update, here is another solution for fixing STGCN:
@ARCH_REGISTRY.register(name='STGCN')

from basicts.

zezhishao avatar zezhishao commented on September 22, 2024

Yes, thank you very much for reporting these errors to me. I have fixed the bug in STGCN.

However, I can't reproduce these errors in Graph WaveNet and STNorm. Here are my actions:

  1. clone the BasicTS project git clone https://github.com/zezhishao/BasicTS.git
  2. download the raw_data and put them in datasets/
  3. run scripts to preprocess PEMS03 dataset python /path/to/BasicTS/scripts/data_preparation/PEMS03/generate_training_data.py
  4. run the model, e.g., easytrain -c basicts/options/STNorm/STNorm_PEMS03.py --gpus '0', easytrain -c basicts/options/GraphWaveNet/GraphWaveNet_PEMS03.py --gpus '0'.

It looks like they work fine on all datasets on my computer. Do you have more information about these models or any changes to the code?
Please feel free to contact me if you have any questions.

from basicts.

zezhishao avatar zezhishao commented on September 22, 2024

I think it should be caused by different versions of pytorch.
You can contact me via email [email protected].

from basicts.

Ethan1X avatar Ethan1X commented on September 22, 2024

Hi, have you solved this problem? I'm having the same problem.

The analysis found that it may be a Torch version problem, refer to the link:

mengcz13/IJCAI2022_ST-KMRN#1 (comment)

from basicts.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.