QData / spacetimeformer

Multivariate Time Series Forecasting with efficient Transformers. Code for the paper "Long-Range Transformers for Dynamic Spatiotemporal Forecasting."
https://arxiv.org/abs/2109.12218
MIT License
808 stars 191 forks source link

How to set up the env (ModuleNotFoundError: No module named 'spacetimeformer') #54

Closed sam351 closed 2 years ago

sam351 commented 2 years ago

Hello, thank you for opening great project!

Now I'm trying to run the code in the Google Colab. After checking the README.md file, I ran below code in the notebook.

!git clone https://github.com/QData/spacetimeformer.git
!pip install -r spacetimeformer/requirements.txt  # SAME AS cd spacetimeformer && pip install -r requirements.txt 
!pip install -e

After all the packages were successfully installed, I tried below code.

!python spacetimeformer/spacetimeformer/train.py spacetimeformer pems-bay .... (AS written in the `README.md`)

However, it raised an error below

Traceback (most recent call last):
  File "spacetimeformer/train.py", line 11, in <module>
    import spacetimeformer as stf
ModuleNotFoundError: No module named 'spacetimeformer'

I think it's because there's no module spacetimeformer.py in the repo, as well as spacetimeformer is not included in requirements.txt Is there anything I missed while setting the environment? Or did I make a mistake when running train.py?

Thank you for your help in advance :)

sam351 commented 2 years ago

Ooops.... I just found out that there's typo in my code...

!pip install -e spacetimeformer

By adding spacetimeformer after -e in the command fixed the problem...

Thank you :)