-
-
Notifications
You must be signed in to change notification settings - Fork 87
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
Comments
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, |
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. |
1. System Info
linux
2. Information
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.
The text was updated successfully, but these errors were encountered: