andreikitaitsev / SymINDy

Symbolic Identification of Non-linear Dynamics. The method generalizes the SINDy algorithm by combining sparse and genetic-programming-based symbolic regression.
MIT License
72 stars 6 forks source link

Parallelization does not work #20

Open andreikitaitsev opened 2 years ago

andreikitaitsev commented 2 years ago

Using Scoop in a manner described at DEAP page does not work. Error message:

ImportError: cannot import name 'Iterable' from 'collections' (C:\Users\AndreiKitaitsev\AppData\Local\Programs\Python\Python310\lib\collections__init__.py) toolbox, creator, history = _create_toolbox(pset, ntrees, max_depth=self.max_depth) File "c:\users\andreikitaitsev\documents\sind_and_symbolic_regression\symindy\symindy\symindy.py", line 133, in _create_toolbox from scoop import futures File "C:\Users\AndreiKitaitsev\Documents\SIND_and_symbolic_regression\env1\lib\site-packages\scoop\futures.py", line 19, in toolbox, creator, pset, history = self.configure_DEAP( toolbox, creator, history = _create_toolbox(pset, ntrees, max_depth=self.max_depth) File "c:\users\andreikitaitsev\documents\sind_and_symbolic_regression\symindy\symindy\symindy.py", line 133, in _create_toolbox File "c:\users\andreikitaitsev\documents\sind_and_symbolic_regression\symindy\symindy\symindy.py", line 154, in configure_DEAP from scoop import futures File "C:\Users\AndreiKitaitsev\Documents\SIND_and_symbolic_regression\env1\lib\site-packages\scoop\futures.py", line 19, in from collections import namedtuple, Iterable ImportError: cannot import name 'Iterable' from 'collections' (C:\Users\AndreiKitaitsev\AppData\Local\Programs\Python\Python310\lib\collections__init.py) toolbox, creator, history = _create_toolbox(pset, ntrees, max_depth=self.max_depth) File "c:\users\andreikitaitsev\documents\sind_and_symbolic_regression\symindy\symindy\symindy.py", line 133, in _create_toolbox from scoop import futures File "C:\Users\AndreiKitaitsev\Documents\SIND_and_symbolic_regression\env1\lib\site-packages\scoop\futures.py", line 19, in from collections import namedtuple, Iterable ImportError: cannot import name 'Iterable' from 'collections' (C:\Users\AndreiKitaitsev\AppData\Local\Programs\Python\Python310\lib\collections\init.py) from collections import namedtuple, Iterable ImportError: cannot import name 'Iterable' from 'collections' (C:\Users\AndreiKitaitsev\AppData\Local\Programs\Python\Python310\lib\collections\init__.py) [2022-05-25 15:50:37,313] launcher (127.0.0.1:60684) INFO Root process is done. [2022-05-25 15:50:37,314] launcher (127.0.0.1:60684) INFO Finished cleaning spawned subprocesses.

Launching multiprocessing Pool requires running the module as main.

matteoettam09 commented 2 years ago

Consider ignoring scoop and use something like this