I've been having this problem for over a week. I was developing the algorithm on my laptop, but I had to switch computers, and now I'm getting this error. I'm also encountering the same error when using Google Colab. The algorithm used to work without any issues on my old computer.
The error occurs when running the model.fit cell.
history_Micro_0 = model.fit(loader_tr_Micro_0.load(), steps_per_epoch=loader_tr_Micro_0.steps_per_epoch, epochs=epocas, validation_data=loader_va_Micro_0.load(), validation_steps=loader_va_Micro_0.steps_per_epoch, callbacks=[callback], verbose=2)
{
"name": "ValueError",
"message": "Unrecognized data type: x=<spektral.data.loaders.BatchLoader object at 0x00000218FBD8DA90> (of type <class 'spektral.data.loaders.BatchLoader'>)",
"stack": "---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
Cell In[16], line 1
----> 1 history_Micro_0 = model.fit(loader_tr_Micro_0.load(), steps_per_epoch=loader_tr_Micro_0.steps_per_epoch, epochs=epocas, validation_data=loader_va_Micro_0, validation_steps=loader_va_Micro_0.steps_per_epoch, callbacks=[callback], verbose=2)
File c:\Users\danie\AppData\Local\Programs\Python\Python311\Lib\site-packages\keras\src\utils\traceback_utils.py:122, in filter_traceback..error_handler(*args, **kwargs)
119 filtered_tb = _process_traceback_frames(e.traceback)
120 # To get the full stack trace, call:
121 # keras.config.disable_traceback_filtering()
--> 122 raise e.with_traceback(filtered_tb) from None
123 finally:
124 del filtered_tb
File c:\Users\danie\AppData\Local\Programs\Python\Python311\Lib\site-packages\keras\src\trainers\data_adapters\init.py:120, in get_data_adapter(x, y, sample_weight, batch_size, steps_per_epoch, shuffle, class_weight)
112 return GeneratorDataAdapter(x)
113 # TODO: should we warn or not?
114 # warnings.warn(
115 # "shuffle=True was passed, but will be ignored since the "
(...)
118 # )
119 else:
--> 120 raise ValueError(f"Unrecognized data type: x={x} (of type {type(x)})")
ValueError: Unrecognized data type: x=<spektral.data.loaders.BatchLoader object at 0x00000218FBD8DA90> (of type <class 'spektral.data.loaders.BatchLoader'>)"
}
I've been having this problem for over a week. I was developing the algorithm on my laptop, but I had to switch computers, and now I'm getting this error. I'm also encountering the same error when using Google Colab. The algorithm used to work without any issues on my old computer.
The error occurs when running the model.fit cell.
history_Micro_0 = model.fit(loader_tr_Micro_0.load(), steps_per_epoch=loader_tr_Micro_0.steps_per_epoch, epochs=epocas, validation_data=loader_va_Micro_0.load(), validation_steps=loader_va_Micro_0.steps_per_epoch, callbacks=[callback], verbose=2)
{
"name": "ValueError",
"message": "Unrecognized data type: x=<spektral.data.loaders.BatchLoader object at 0x00000218FBD8DA90> (of type <class 'spektral.data.loaders.BatchLoader'>)",
"stack": "---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
Cell In[16], line 1
----> 1 history_Micro_0 = model.fit(loader_tr_Micro_0.load(), steps_per_epoch=loader_tr_Micro_0.steps_per_epoch, epochs=epocas, validation_data=loader_va_Micro_0, validation_steps=loader_va_Micro_0.steps_per_epoch, callbacks=[callback], verbose=2)
File c:\Users\danie\AppData\Local\Programs\Python\Python311\Lib\site-packages\keras\src\utils\traceback_utils.py:122, in filter_traceback..error_handler(*args, **kwargs)
119 filtered_tb = _process_traceback_frames(e.traceback)
120 # To get the full stack trace, call:
121 #
keras.config.disable_traceback_filtering()--> 122 raise e.with_traceback(filtered_tb) from None
123 finally:
124 del filtered_tb
File c:\Users\danie\AppData\Local\Programs\Python\Python311\Lib\site-packages\keras\src\trainers\data_adapters\init.py:120, in get_data_adapter(x, y, sample_weight, batch_size, steps_per_epoch, shuffle, class_weight)
112 return GeneratorDataAdapter(x)
113 # TODO: should we warn or not?
114 # warnings.warn(
115 # "
shuffle=Truewas passed, but will be ignored since the "(...)
118 # )
119 else:
--> 120 raise ValueError(f"Unrecognized data type: x={x} (of type {type(x)})")
ValueError: Unrecognized data type: x=<spektral.data.loaders.BatchLoader object at 0x00000218FBD8DA90> (of type <class 'spektral.data.loaders.BatchLoader'>)"
}