architecture-building-systems / CityEnergyAnalyst

The City Energy Analyst (CEA)
https://www.cityenergyanalyst.com/
MIT License
197 stars 66 forks source link

Error in decentralized optimization (DH) | AttributeError deap.creator | CH reference case #3290

Closed TimMan2020 closed 1 year ago

TimMan2020 commented 1 year ago

Describe the bug CEA fails in the supply systems optimization module: AttributeError: Can't get attribute 'Individual' on <module 'deap.creator' from 'C:\\_Programme_Arbeit\\CityEnergyAnalyst\\Dependencies\\Python\\lib\\site-packages\\deap\\creator.py'>. Please see the full error message below. The error seems very similar to #3214. Strangely, the error did not occur up until a few weeks ago. Reinstalling CEA did not help. @martin-mosteiro @lguilhermers @MatNif Does this look familiar? Thanks for your help!

To Reproduce

  1. Use CEA V3.32
  2. Extract reference case and run default DH workflow
  3. See error

Expected behaviour Completed centralized optimization for DH without critical error.

Hardware:

Error message


Running `cea optimization` with the following parameters:
- general:debug = False
  (default: False)
- general:scenario = P:\_Transfer\CEA\02_Projects\CH\01_Baseline_Default
  (default: {general:project}\{general:scenario-name})
- general:multiprocessing = True
  (default: True)
- general:number-of-cpus-to-keep-free = 1
  (default: 1)
- optimization:network-type = DH
  (default: DH)
- optimization:technologies-dh = ['NG_Cogen', 'WB_Cogen', 'DB_Cogen', 'NG_BaseBoiler', 'NG_PeakBoiler', 'WS_HP', 'SS_HP', 'GS_HP', 'DS_HP', 'PVT', 'SC_ET', 'SC_FP', 'PV']
  (default: ['NG_Cogen', 'WB_Cogen', 'DB_Cogen', 'NG_BaseBoiler', 'NG_PeakBoiler', 'WS_HP', 'SS_HP', 'GS_HP', 'DS_HP', 'PVT', 'SC_ET', 'SC_FP', 'PV'])
- optimization:technologies-dc = ['NG_Trigen', 'WS_BaseVCC', 'WS_PeakVCC', 'AS_BaseVCC', 'AS_PeakVCC', 'Storage', 'PV']
  (default: ['NG_Trigen', 'WS_BaseVCC', 'WS_PeakVCC', 'AS_BaseVCC', 'AS_PeakVCC', 'Storage', 'PV'])
- optimization:objective-functions-dc = ['system_energy_demand', 'anthropogenic_heat']
  (default: ['system_energy_demand', 'anthropogenic_heat'])
- optimization:cold-storage-type = TES2
  (default: TES2)
- optimization:population-size = 5
  (default: None)
- optimization:number-of-generations = 2
  (default: 100)
- optimization:random-seed = 100
  (default: 100)
- optimization:mutation-prob = 0.1
  (default: 0.1)
- optimization:mutation-method-integer = Flipbit
  (default: Flipbit)
- optimization:mutation-method-continuous = Polynomial
  (default: Polynomial)
- optimization:crossover-prob = 0.9
  (default: 0.9)
- optimization:crossover-method-integer = Uniform
  (default: Uniform)
- optimization:crossover-method-continuous = Uniform
  (default: Uniform)
PRE-PROCESSING
PRE-PROCESSING 0/4: initialize directory
PRE-PROCESSING 1/4: weather features
PRE-PROCESSING 2/4: conversion systems database
PRE-PROCESSING 3/4: feedstocks systems database
PRE-PROCESSING 4/4: network features
11 seconds process time for Network summary for configuration 11111111111111
SUPPLY SYSTEMS OPTIMIZATION
Process SpawnPoolWorker-106:Process SpawnPoolWorker-108:

Traceback (most recent call last):Traceback (most recent call last):

  File "C:\_Programme_Arbeit\CityEnergyAnalyst\Dependencies\Python\lib\multiprocessing\process.py", line 315, in _bootstrap  File "C:\_Programme_Arbeit\CityEnergyAnalyst\Dependencies\Python\lib\multiprocessing\process.py", line 315, in _bootstrap

    self.run()    self.run()

Process SpawnPoolWorker-107:  File "C:\_Programme_Arbeit\CityEnergyAnalyst\Dependencies\Python\lib\multiprocessing\process.py", line 108, in run  File "C:\_Programme_Arbeit\CityEnergyAnalyst\Dependencies\Python\lib\multiprocessing\process.py", line 108, in run

    self._target(*self._args, **self._kwargs)    self._target(*self._args, **self._kwargs)

  File "C:\_Programme_Arbeit\CityEnergyAnalyst\Dependencies\Python\lib\multiprocessing\pool.py", line 114, in worker  File "C:\_Programme_Arbeit\CityEnergyAnalyst\Dependencies\Python\lib\multiprocessing\pool.py", line 114, in worker

    task = get()    task = get()

  File "C:\_Programme_Arbeit\CityEnergyAnalyst\Dependencies\Python\lib\multiprocessing\queues.py", line 358, in get  File "C:\_Programme_Arbeit\CityEnergyAnalyst\Dependencies\Python\lib\multiprocessing\queues.py", line 358, in get

    return _ForkingPickler.loads(res)    return _ForkingPickler.loads(res)

AttributeError: Can't get attribute 'Individual' on <module 'deap.creator' from 'C:\\_Programme_Arbeit\\CityEnergyAnalyst\\Dependencies\\Python\\lib\\site-packages\\deap\\creator.py'>AttributeError: Can't get attribute 'Individual' on <module 'deap.creator' from 'C:\\_Programme_Arbeit\\CityEnergyAnalyst\\Dependencies\\Python\\lib\\site-packages\\deap\\creator.py'>

Traceback (most recent call last):
  File "C:\_Programme_Arbeit\CityEnergyAnalyst\Dependencies\Python\lib\multiprocessing\process.py", line 315, in _bootstrap
    self.run()
  File "C:\_Programme_Arbeit\CityEnergyAnalyst\Dependencies\Python\lib\multiprocessing\process.py", line 108, in run
    self._target(*self._args, **self._kwargs)Process SpawnPoolWorker-105:

  File "C:\_Programme_Arbeit\CityEnergyAnalyst\Dependencies\Python\lib\multiprocessing\pool.py", line 114, in worker
    task = get()
  File "C:\_Programme_Arbeit\CityEnergyAnalyst\Dependencies\Python\lib\multiprocessing\queues.py", line 358, in get
    return _ForkingPickler.loads(res)
AttributeError: Can't get attribute 'Individual' on <module 'deap.creator' from 'C:\\_Programme_Arbeit\\CityEnergyAnalyst\\Dependencies\\Python\\lib\\site-packages\\deap\\creator.py'>
Process SpawnPoolWorker-104:
Traceback (most recent call last):
  File "C:\_Programme_Arbeit\CityEnergyAnalyst\Dependencies\Python\lib\multiprocessing\process.py", line 315, in _bootstrap
    self.run()
  File "C:\_Programme_Arbeit\CityEnergyAnalyst\Dependencies\Python\lib\multiprocessing\process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "C:\_Programme_Arbeit\CityEnergyAnalyst\Dependencies\Python\lib\multiprocessing\pool.py", line 114, in workerTraceback (most recent call last):

    task = get()  File "C:\_Programme_Arbeit\CityEnergyAnalyst\Dependencies\Python\lib\multiprocessing\process.py", line 315, in _bootstrap

  File "C:\_Programme_Arbeit\CityEnergyAnalyst\Dependencies\Python\lib\multiprocessing\queues.py", line 358, in get    self.run()

    return _ForkingPickler.loads(res)  File "C:\_Programme_Arbeit\CityEnergyAnalyst\Dependencies\Python\lib\multiprocessing\process.py", line 108, in run

    self._target(*self._args, **self._kwargs)AttributeError: Can't get attribute 'Individual' on <module 'deap.creator' from 'C:\\_Programme_Arbeit\\CityEnergyAnalyst\\Dependencies\\Python\\lib\\site-packages\\deap\\creator.py'>

  File "C:\_Programme_Arbeit\CityEnergyAnalyst\Dependencies\Python\lib\multiprocessing\pool.py", line 114, in worker
    task = get()
  File "C:\_Programme_Arbeit\CityEnergyAnalyst\Dependencies\Python\lib\multiprocessing\queues.py", line 358, in get
    return _ForkingPickler.loads(res)
AttributeError: Can't get attribute 'Individual' on <module 'deap.creator' from 'C:\\_Programme_Arbeit\\CityEnergyAnalyst\\Dependencies\\Python\\lib\\site-packages\\deap\\creator.py'>```
MatNif commented 1 year ago

Hi @TimMan2020,

Sorry to have let you wait for an answer to this issue for so long as well.

Are you still struggling with this issue? I believe there was an issue with the deap library at the time, which I think has since been resolve (or at least I haven't seen this error in a while now).