TypeError: must be real number, not NoneType

I’m running the docker container version on a MySQL database.
I am trying to train a timeseries dataset on 5300 rows.

I keep getting this error though when I try to train it. Is this a bug or am I doing something wrong.

mindsdb_1  | ERROR:mindsdb-logger-ceb455a2-67d5-11eb-b598-0242ac140003---d5a18bca-a038-45f2-baae-9fa6818fa4a9:/opt/conda/lib/python3.8/site-packages/mindsdb_native/libs/controllers/transaction.py:181 - Could not load module ModelInterface
mindsdb_1  | 
mindsdb_1  | ERROR:mindsdb-logger-ceb455a2-67d5-11eb-b598-0242ac140003---d5a18bca-a038-45f2-baae-9fa6818fa4a9:/opt/conda/lib/python3.8/site-packages/mindsdb_native/libs/controllers/transaction.py:271 - must be real number, not NoneType
mindsdb_1  | 
mindsdb_1  | Process LearnProcess-1:5:
mindsdb_1  | Traceback (most recent call last):
mindsdb_1  |   File "/opt/conda/lib/python3.8/multiprocessing/process.py", line 315, in _bootstrap
mindsdb_1  |     self.run()
mindsdb_1  |   File "/opt/conda/lib/python3.8/site-packages/mindsdb/interfaces/native/learn_process.py", line 28, in run
mindsdb_1  |     mdb.learn(
mindsdb_1  |   File "/opt/conda/lib/python3.8/site-packages/mindsdb_native/libs/controllers/predictor.py", line 317, in learn
mindsdb_1  |     self.transaction.run()
mindsdb_1  |   File "/opt/conda/lib/python3.8/site-packages/mindsdb_native/libs/controllers/transaction.py", line 277, in run
mindsdb_1  |     self._run()
mindsdb_1  |   File "/opt/conda/lib/python3.8/site-packages/mindsdb_native/libs/controllers/transaction.py", line 273, in _run
mindsdb_1  |     raise e
mindsdb_1  |   File "/opt/conda/lib/python3.8/site-packages/mindsdb_native/libs/controllers/transaction.py", line 246, in _run
mindsdb_1  |     self._call_phase_module(module_name='ModelInterface', mode='train')
mindsdb_1  |   File "/opt/conda/lib/python3.8/site-packages/mindsdb_native/libs/controllers/transaction.py", line 178, in _call_phase_module
mindsdb_1  |     ret = module(self.session, self)(**kwargs)
mindsdb_1  |   File "/opt/conda/lib/python3.8/site-packages/mindsdb_native/libs/phases/base_module.py", line 53, in __call__
mindsdb_1  |     ret = self.run(**kwargs)
mindsdb_1  |   File "/opt/conda/lib/python3.8/site-packages/mindsdb_native/libs/phases/model_interface/model_interface.py", line 18, in run
mindsdb_1  |     self.transaction.model_backend.train()
mindsdb_1  |   File "/opt/conda/lib/python3.8/site-packages/mindsdb_native/libs/phases/model_interface/lightwood_backend.py", line 357, in train
mindsdb_1  |     lightwood_train_ds = lightwood.api.data_source.DataSource(
mindsdb_1  |   File "/opt/conda/lib/python3.8/site-packages/lightwood/api/data_source.py", line 104, in __init__
mindsdb_1  |     self.encoders = self._prepare_encoders()
mindsdb_1  |   File "/opt/conda/lib/python3.8/site-packages/lightwood/api/data_source.py", line 381, in _prepare_encoders
mindsdb_1  |     encoder_instance = self._prepare_column_encoder(config,
mindsdb_1  |   File "/opt/conda/lib/python3.8/site-packages/lightwood/api/data_source.py", line 336, in _prepare_column_encoder
mindsdb_1  |     encoder_instance.prepare(column_data, previous_target_data=training_data['previous'])
mindsdb_1  |   File "/opt/conda/lib/python3.8/site-packages/lightwood/encoders/time_series/rnn.py", line 122, in prepare
mindsdb_1  |     priming_data, lengths_data = self._prepare_raw_data(priming_data)
mindsdb_1  |   File "/opt/conda/lib/python3.8/site-packages/lightwood/encoders/time_series/rnn.py", line 93, in _prepare_raw_data
mindsdb_1  |     t = torch.tensor(e, dtype=torch.float)
mindsdb_1  | TypeError: must be real number, not NoneType
1 Like

Hi @AtherionGG, thanks for reaching out!

That’s most likely a bug. Can you share the dataset or more information about it? In particular, I’d be curious to know whether the column marked as target variable has empty values.

I think I found the issue and probably a bug/feature you could add or make sure it works.

I had column entry_date DATE NOT NULL
I changed it to entry_date DATETIME NOT NULL

It fixed the issue.

2 Likes