dreamquark-ai / tabnet

PyTorch implementation of TabNet paper : https://arxiv.org/pdf/1908.07442.pdf
https://dreamquark-ai.github.io/tabnet/
MIT License
2.56k stars 473 forks source link

Getting 'RuntimeError: index -1 is out of bounds for dimension 1 with size 1483' #408

Closed RobKwiatkowski closed 2 years ago

RobKwiatkowski commented 2 years ago

Describe the bug I'm getting RuntimeError: index -1 is out of bounds for dimension 1 with size 1483

What is the current behavior? After training a model for a binary classification problem I get the above-mentioned error.

If the current behavior is a bug, please provide the steps to reproduce. My model (fit_model): tabnet_model_test_1.zip

TabNetClassifier(n_d=32, n_a=64, n_steps=3, gamma=1.3, cat_idxs=[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43], cat_dims=[], cat_emb_dim=1, n_independent=2, n_shared=2, epsilon=1e-15, momentum=0.02, lambda_sparse=0.001, seed=1946, clip_value=None, verbose=1, optimizer_fn=<class 'torch.optim.adam.Adam'>, optimizer_params={'lr': 0.02}, scheduler_fn=<class 'torch.optim.lr_scheduler.CosineAnnealingLR'>, scheduler_params={'T_max': 6}, mask_type='sparsemax', input_dim=1483, output_dim=2, device_name='auto')

Test data shape (tmp): (10, 1483) tmp.csv

Test data type: dtype('float64')

Then running: fit_model.predict_proba(tmp)

Expected behavior

It should generate probabilities for 10 provided examples.

Screenshots

image

Other relevant information: python version: 3.10

Additional context

Optimox commented 2 years ago

Please remove NaNs from your dataframe first.