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

Segmentation fault (core dumped) #248

Closed
1 of 2 tasks
3uchen opened this issue Nov 29, 2023 · 2 comments
Closed
1 of 2 tasks

Segmentation fault (core dumped) #248

3uchen opened this issue Nov 29, 2023 · 2 comments

Comments

@3uchen
Copy link

3uchen commented Nov 29, 2023

1. System Info

linux

2. Information

  • The official example scripts
  • My own created scripts

3. Reproduction

import os
os.environ['CUDA_VISIBLE_DEVICES'] = '2'
import faulthandler

在import之后直接添加以下启用代码即可

faulthandler.enable()
import numpy as np
from sklearn.preprocessing import StandardScaler
from pygrinder import mcar, masked_fill
from pypots.data import load_specific_dataset
from pypots.imputation import SAITS
from pypots.utils.metrics import cal_mae

Data preprocessing. Tedious, but PyPOTS can help.

print('ok')
data = load_specific_dataset('physionet_2012') # PyPOTS will automatically download and extract it.
X = data['X']
print(X)
num_samples = len(X['RecordID'].unique())
X = X.drop(['RecordID', 'Time'], axis = 1)
X = StandardScaler().fit_transform(X.to_numpy())
X = X.reshape(num_samples, 48, -1)
X_intact, X, missing_mask, indicating_mask = mcar(X, 0.1) # hold out 10% observed values as ground truth
X = masked_fill(X, 1 - missing_mask, np.nan)
dataset = {"X": X}
print(dataset["X"].shape) # (11988, 48, 37), 11988 samples, 48 time steps, 37 features

Model training. This is PyPOTS showtime.

saits = SAITS(n_steps=48, n_features=37, n_layers=2, d_model=256, d_inner=128, n_heads=4, d_k=64, d_v=64, dropout=0.1, epochs=10)

Here I use the whole dataset as the training set because ground truth is not visible to the model, you can also split it into train/val/test sets

saits.fit(dataset)
imputation = saits.impute(dataset) # impute the originally-missing values and artificially-missing values
mae = cal_mae(imputation, X_intact, indicating_mask) # calculate mean absolute error on the ground truth (artificially-missing values)

4. Expected behavior

I am using your example applying SAITS on PhysioNet2012 for imputation. While performing to "from pypots.data import load_specific_dataset", the bug "Segmentation fault (core dumped)" occurs.

@3uchen 3uchen added the bug Something isn't working label Nov 29, 2023
@WenjieDu
Copy link
Owner

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

This is an unqualified issue. You should provide more info about your system, like which version of Python and which PyPOTS you're using. Only noting "the bug Segmentation fault (core dumped) occurs" doesn't help at all. you should provide more details about the error you met with, and the full Traceback log is necessary.

@WenjieDu WenjieDu added potential bug and removed bug Something isn't working labels Dec 2, 2023
@WenjieDu WenjieDu closed this as not planned Won't fix, can't repro, duplicate, stale Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants