Closed sonnguyen129 closed 1 year ago
Here is a link to a notebook using tabnet and Optuna : https://www.kaggle.com/code/neilgibbons/tuning-tabnet-with-optuna
Your code does not use the library in a straight forward way so I'm not sure I will be able to help you more than that.
Hi @Optimox , I solved it with X_train = X_train.astype(float)
. Can you explain it?
Why this warning in log is appear so much?
/usr/local/lib/python3.7/dist-packages/pytorch_tabnet/abstract_model.py:75: UserWarning: Device used : cuda
warnings.warn(f"Device used : {self.device}")
/usr/local/lib/python3.7/dist-packages/pytorch_tabnet/callbacks.py:172: UserWarning: Best weights from best epoch are automatically used!
warnings.warn(wrn_msg)
I guess numpy array can sometimes contain mixed types which can cause errors when switching to torch tensors...
About the indicative warnings: I think it's helpful to understand what is going on by default, I know it upsets some people. I don't really know if it is a good or bad idea to have put them in the first place. In doubt, I'm leaving them for the moment.
Describe the bug
When I tried to train TabNet with Optuna, I cause this error.
What is the current behavior?
If the current behavior is a bug, please provide the steps to reproduce.
Here is my TabNet:
Here is the training code
Expected behavior
Screenshots
Other relevant information: poetry version:
python version: 3.8.10 Operating System: Additional tools:
Additional context
Hope to hear from you soon