Open johnlvjinya opened 2 years ago
File "...\lib\site-packages\deap\benchmarks\tools.py", line 315, in igd if not scipy: NameError: name 'scipy' is not defined
################################################## scipy_import = True try: from scipy.spatial import distance except ImportError: scipy_import = False
def igd(A, Z): """Inverse generational distance. """ if not scipy_import: raise ImportError("idg requires scipy module") distances = distance.cdist(A, Z) return numpy.average(numpy.min(distances, axis=0)) ####################################################
I also find this problem. Why no any other comments?
That is weird because there is no if not scipy line in the code referenced. Maybe a configuration problem with multiple installed version of deap?
if not scipy
File "...\lib\site-packages\deap\benchmarks\tools.py", line 315, in igd if not scipy: NameError: name 'scipy' is not defined
################################################## scipy_import = True try: from scipy.spatial import distance except ImportError: scipy_import = False
def igd(A, Z): """Inverse generational distance. """ if not scipy_import: raise ImportError("idg requires scipy module") distances = distance.cdist(A, Z) return numpy.average(numpy.min(distances, axis=0)) ####################################################