YttriLab / A-SOID

An active learning platform for expert-guided, data efficient discovery of behavior.
Other
55 stars 7 forks source link

error on discover step: setting array element with sequence; Numpy deprecation v1.24.4 #48

Closed vickerse1 closed 1 year ago

vickerse1 commented 1 year ago

Hi,

After rerunning the discovery step with different parameters, I was able to progress through to the last streamlit GUI analysis step.

When I select Group 1 and Group 2 to be added to training set, I get the following error in the GUI:


ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (70,) + inhomogeneous part. Traceback: File "C:\ProgramData\Anaconda3\envs\asoid-test\lib\site-packages\streamlit\scriptrunner\script_runner.py", line 557, in _run_script exec(code, module.dict) File "C:\ProgramData\Anaconda3\envs\asoid-test\lib\site-packages\asoid\app.py", line 332, in main() File "C:\ProgramData\Anaconda3\envs\asoid-test\lib\site-packages\asoid\app.py", line 328, in main application_function() File "C:\ProgramData\Anaconda3\envs\asoid-test\lib\site-packages\asoid\apps\G_unsupervised_discovery.py", line 15, in main explorer.main() File "C:\ProgramData\Anaconda3\envs\asoid-test\lib\site-packages\asoid\utils\unsupervised_discovery.py", line 343, in main self.show_results() File "C:\ProgramData\Anaconda3\envs\asoid-test\lib\site-packages\asoid\utils\unsupervised_discovery.py", line 319, in show_results self.save_subclasses(selected_subclasses_num) File "C:\ProgramData\Anaconda3\envs\asoid-test\lib\site-packages\asoid\utils\unsupervised_discovery.py", line 253, in save_subclasses self.export_to_new_project(split_targets) File "C:\ProgramData\Anaconda3\envs\asoid-test\lib\site-packages\asoid\utils\unsupervised_discovery.py", line 203, in export_to_new_project [np.array(self.processed_input_data), np.array(new_targets)]

The command line error contains the following at the end:

ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (70,) + inhomogeneous part.

Can you help me with this?

Thanks,

Evan

JensBlack commented 1 year ago

Hi Evan,

great bug hunting so far! Yes, it's the same problem we solved yesterday, but I apparently missed this line in the discovery step. For other people reading this: It is an issue with the newest numpy version, where np.arrays of nested lists have to declare dtype = object explicitly or fail if not all lists are the same length.

I'll fix it ASAP.