Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tutorial is not working #431

Open
1 of 2 tasks
roijalbaker opened this issue Jun 10, 2024 · 6 comments
Open
1 of 2 tasks

Tutorial is not working #431

roijalbaker opened this issue Jun 10, 2024 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@roijalbaker
Copy link

1. System Info

Using the Google Colab space

2. Information

  • The official example scripts
  • My own created scripts

3. Reproduction

Run this script in Google CoLab

2024-06-10 10:05:03 [INFO]: Have set the random seed as 2204 for numpy and pytorch.
2024-06-10 10:05:03 [INFO]: Loading the dataset physionet_2012 with TSDB (https://github.com/WenjieDu/Time_Series_Data_Beans)...
2024-06-10 10:05:03 [INFO]: Starting preprocessing physionet_2012...
2024-06-10 10:05:03 [INFO]: You're using dataset physionet_2012, please cite it properly in your work. You can find its reference information at the below link: 
https://github.com/WenjieDu/TSDB/tree/main/dataset_profiles/physionet_2012
2024-06-10 10:05:03 [INFO]: Start downloading...
2024-06-10 10:05:14 [INFO]: Successfully downloaded data to /tmp/tmpopu79y31/set-a.tar.gz
2024-06-10 10:05:14 [INFO]: Successfully extracted data to /root/.tsdb/physionet_2012
2024-06-10 10:05:25 [INFO]: Successfully downloaded data to /tmp/tmpkuq3h2j0/set-b.tar.gz
2024-06-10 10:05:26 [INFO]: Successfully extracted data to /root/.tsdb/physionet_2012
2024-06-10 10:05:36 [INFO]: Successfully downloaded data to /tmp/tmpp87bgnsx/set-c.tar.gz
2024-06-10 10:05:37 [INFO]: Successfully extracted data to /root/.tsdb/physionet_2012
2024-06-10 10:05:37 [INFO]: Successfully downloaded data to /root/.tsdb/physionet_2012/Outcomes-a.txt
2024-06-10 10:05:38 [INFO]: Successfully downloaded data to /root/.tsdb/physionet_2012/Outcomes-b.txt
2024-06-10 10:05:38 [INFO]: Successfully downloaded data to /root/.tsdb/physionet_2012/Outcomes-c.txt
2024-06-10 10:05:43 [WARNING]: Ignore 140501, because its len==1, having no time series data
2024-06-10 10:05:48 [WARNING]: Ignore 140936, because its len==1, having no time series data
2024-06-10 10:06:03 [WARNING]: Ignore 141264, because its len==1, having no time series data
2024-06-10 10:06:19 [WARNING]: Ignore 142998, because its len==1, having no time series data
2024-06-10 10:06:19 [WARNING]: Ignore 147514, because its len==1, having no time series data
2024-06-10 10:06:22 [WARNING]: Ignore 150649, because its len==1, having no time series data
2024-06-10 10:06:28 [WARNING]: Ignore 142731, because its len==1, having no time series data
2024-06-10 10:06:28 [WARNING]: Ignore 150309, because its len==1, having no time series data
2024-06-10 10:06:36 [WARNING]: Ignore 145611, because its len==1, having no time series data
2024-06-10 10:06:43 [WARNING]: Ignore 143656, because its len==1, having no time series data
2024-06-10 10:06:52 [WARNING]: Ignore 156254, because its len==1, having no time series data
2024-06-10 10:06:57 [WARNING]: Ignore 155655, because its len==1, having no time series data
2024-06-10 10:07:28 [INFO]: Successfully saved to /root/.tsdb/physionet_2012/physionet_2012_cache.pkl
2024-06-10 10:07:28 [INFO]: Loaded successfully!
---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
[<ipython-input-2-013a7940bff8>](https://localhost:8080/#) in <cell line: 7>()
      5 
      6 # Load the PhysioNet-2012 dataset
----> 7 physionet2012_dataset = gene_physionet2012(artificially_missing_rate=0.1)
      8 
      9 # Take a look at the generated PhysioNet-2012 dataset, you'll find that everything has been prepared for you,

2 frames
[/usr/local/lib/python3.10/dist-packages/pypots/data/load_preprocessing.py](https://localhost:8080/#) in preprocess_physionet2012(data)
     28     data["static_features"].remove("ICUType")  # keep ICUType for now
     29     # remove the other static features, e.g. age, gender
---> 30     X = data["X"].drop(data["static_features"], axis=1)
     31 
     32     def apply_func(df_temp):  # pad and truncate to set the max length of samples as 48

KeyError: 'X'

4. Expected behavior

I expect no error in the second cell of the notebook

@roijalbaker roijalbaker added the bug Something isn't working label Jun 10, 2024
Copy link

Hi there 👋,

Thank you so much for your attention to PyPOTS! You can follow me on GitHub to receive the latest news of PyPOTS. If you find PyPOTS helpful to your work, please star⭐️ this repository. Your star is your recognition, which can help more people notice PyPOTS and grow PyPOTS community. It matters and is definitely a kind of contribution to the community.

I have received your message and will respond ASAP. Thank you for your patience! 😃

Best,
Wenjie

@WenjieDu
Copy link
Owner

WenjieDu commented Jun 10, 2024

@roijalbaker This error is caused by a recent TSDB update. To make things work, you should install tsdb==0.3.1, rather than v0.4.

@V50-ikun
Copy link

@WenjieDu 我也遇到了同样的问题,安装了tsdb==0.3.1还是报错

@V50-ikun
Copy link

@WenjieDu 我print了key值,如图所示
Snipaste_2024-06-10_22-08-55

@WenjieDu
Copy link
Owner

@WenjieDu 我也遇到了同样的问题,安装了tsdb==0.3.1还是报错

@V50-ikun After downgrading from v0.4 to v0.3.1, please remove all files with .pkl suffix under ~/.tsdb. You can run with the command rm -rf ~/.tsdb/*/*.pkl, or directly delete ~/.tsdb the whole directory.

@V50-ikun
Copy link

@WenjieDu 问题解决了,非常感谢!

@WenjieDu WenjieDu self-assigned this Jun 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants