AttributeError - Lesson 8 Cadet Match

Hi,

I have finisched all of the CADET Tutorial 1-7. When I run the script from Lesson 8 CADET-Match the error appeared as you can see the Foto.
image

And you can read the entire script (.ipynb) by clicking this link code with error
The only syntax I have changed is “match_config.CADETPath = Cadet.cadet_path.as_posix()”.
Are some packages for running CADET MATCH missing? Or is there anything wrong with the script?

Thanks a lot for the help!

I have been looking at the code and so far I have not found the problem.

I have noticed that the version of CADETMatch is quite old. Can you try running pip install -U cadetmatch to upgrade it?

Hey

I have already upgraded cadetmatch but the error appears still.

2022-12-16 16:00:00,662 match.py print_version 121 CADETMatch starting up version: 0.8.15

2022-12-16 16:00:00,682 match.py print_version 150 attrs version: 21.4.0 tested with 21.2.0

2022-12-16 16:00:00,685 match.py print_version 150 joblib version: 1.1.0 tested with 1.0.1

2022-12-16 16:00:00,688 match.py print_version 150 addict version: 2.4.0 tested with 2.4.0

2022-12-16 16:00:00,691 match.py print_version 150 corner version: 2.2.1 tested with 2.2.1

2022-12-16 16:00:00,693 match.py print_version 150 emcee version: 3.1.3 tested with 3.0.2

2022-12-16 16:00:00,697 match.py print_version 150 SALib version: 1.4.6.1 tested with 1.3.11

2022-12-16 16:00:00,701 match.py print_version 150 psutil version: 5.8.0 tested with 5.8.0

2022-12-16 16:00:00,704 match.py print_version 150 numpy version: 1.21.5 tested with 1.21.1

2022-12-16 16:00:00,707 match.py print_version 150 openpyxl version: 3.0.9 tested with 3.0.7

2022-12-16 16:00:00,710 match.py print_version 150 scipy version: 1.7.3 tested with 1.7.0

2022-12-16 16:00:00,714 match.py print_version 150 matplotlib version: 3.5.1 tested with 3.4.2

2022-12-16 16:00:00,717 match.py print_version 150 pandas version: 1.4.2 tested with 1.3.0

2022-12-16 16:00:00,722 match.py print_version 150 h5py version: 3.6.0 tested with 3.3.0

2022-12-16 16:00:00,726 match.py print_version 150 cadet-python version: 0.11 tested with 0.11

2022-12-16 16:00:00,729 match.py print_version 150 seaborn version: 0.11.2 tested with 0.11.1

2022-12-16 16:00:00,732 match.py print_version 150 scikit-learn version: 1.0.2 tested with 0.24.2

2022-12-16 16:00:00,734 match.py print_version 150 jstyleson version: 0.0.2 tested with 0.2.0

2022-12-16 16:00:00,737 match.py print_version 150 filelock version: 3.6.0 tested with 3.0.12

2022-12-16 16:00:00,741 match.py print_version 150 pymoo version: 0.6.0 tested with 0.4.2.2

2022-12-16 16:00:07,636 util.py setupSimulation 1255 dextran_reference.h5 abstol=1e-06  reltol=1e-06

2022-12-16 16:00:07,637 loggerwriter.py write 10 Traceback (most recent call last):



2022-12-16 16:00:07,637 loggerwriter.py write 10   File "C:\Users\anaconda3\lib\site-packages\CADETMatch\match.py", line 363, in <module>



2022-12-16 16:00:07,639 loggerwriter.py write 10     

2022-12-16 16:00:07,639 loggerwriter.py write 10 main(map_function=map_function)

2022-12-16 16:00:07,639 loggerwriter.py write 10   File "C:\Users\anaconda3\lib\site-packages\CADETMatch\match.py", line 26, in main



2022-12-16 16:00:07,640 loggerwriter.py write 10     

2022-12-16 16:00:07,640 loggerwriter.py write 10 setup(cache, path, map_function)

2022-12-16 16:00:07,640 loggerwriter.py write 10   File "C:\Users\anaconda3\lib\site-packages\CADETMatch\match.py", line 117, in setup



2022-12-16 16:00:07,641 loggerwriter.py write 10     

2022-12-16 16:00:07,641 loggerwriter.py write 10 setupTemplates(cache)

2022-12-16 16:00:07,641 loggerwriter.py write 10   File "C:\Users\anaconda3\lib\site-packages\CADETMatch\match.py", line 273, in setupTemplates



2022-12-16 16:00:07,643 loggerwriter.py write 10     

2022-12-16 16:00:07,643 loggerwriter.py write 10 util.runExperiment(

2022-12-16 16:00:07,643 loggerwriter.py write 10   File "C:\Users\anaconda3\lib\site-packages\CADETMatch\util.py", line 311, in runExperiment



2022-12-16 16:00:07,644 loggerwriter.py write 10     

2022-12-16 16:00:07,644 loggerwriter.py write 10 if simulation.is_file:

2022-12-16 16:00:07,644 loggerwriter.py write 10 AttributeError

2022-12-16 16:00:07,644 loggerwriter.py write 10 : 

2022-12-16 16:00:07,645 loggerwriter.py write 10 'Cadet' object has no attribute 'is_file'

2022-12-16 16:00:07,645 util.py info 54 process shutting down

Please also check that you have a current version of CADET-Python.

pip install cadet-python

Also, quite some time ago, we decided to rename the package name on pypi (to better distinguish it from our core). It was previously registered as cadet. Please do not use this one any more. To uninstall (in case this version was installed on your machine), run the following:

pip uninstall cadet

Hey I have tested following your suggestions. But it does not work. So I try to reinstall them using the following command:

conda install -c conda-forge cadet

conda config --add channels anaconda-fusion
conda config --add channels conda-forge

conda install -c immudzen cadetmatch

It works while using the search method “UNSGA3”.

But with the search method"NSGA3" the error appears.

2022-12-19 11:58:53,934 match.py print_version 116 CADETMatch starting up version: 0.7.1

2022-12-19 11:58:53,960 match.py print_version 144 joblib version: 1.1.0 tested with 1.0.1

2022-12-19 11:58:53,963 match.py print_version 144 addict version: 2.4.0 tested with 2.2.1

2022-12-19 11:58:53,966 match.py print_version 144 corner version: 2.2.1 tested with 2.1.0

2022-12-19 11:58:53,969 match.py print_version 144 emcee version: 3.1.3 tested with 3.0.2

2022-12-19 11:58:53,973 match.py print_version 144 SALib version: 1.4.6.1 tested with 1.3.11

2022-12-19 11:58:53,976 match.py print_version 144 deap version: 1.3.3 tested with 1.3.1

2022-12-19 11:58:53,981 match.py print_version 144 psutil version: 5.8.0 tested with 5.8.0

2022-12-19 11:58:53,983 match.py print_version 144 numpy version: 1.21.5 tested with 1.20.1

2022-12-19 11:58:53,986 match.py print_version 144 openpyxl version: 3.0.9 tested with 3.0.7

2022-12-19 11:58:53,989 match.py print_version 144 scipy version: 1.8.1 tested with 1.6.1

2022-12-19 11:58:53,992 match.py print_version 144 matplotlib version: 3.5.1 tested with 3.3.4

2022-12-19 11:58:53,996 match.py print_version 144 pandas version: 1.4.2 tested with 1.2.3

2022-12-19 11:58:54,000 match.py print_version 144 h5py version: 3.6.0 tested with 3.1.0

2022-12-19 11:58:54,003 match.py print_version 144 cadet-python version: 0.11 tested with 0.11

2022-12-19 11:58:54,006 match.py print_version 144 seaborn version: 0.11.2 tested with 0.11.1

2022-12-19 11:58:54,009 match.py print_version 144 scikit-learn version: 1.0.2 tested with 0.24.1

2022-12-19 11:58:54,012 match.py print_version 144 jstyleson version: 0.0.2 tested with 0.0.2

2022-12-19 11:58:54,016 match.py print_version 144 filelock version: 3.6.0 tested with 3.0.12

2022-12-19 11:58:55,517 util.py setupSimulation 1276 dextran_reference.h5 abstol=1e-06  reltol=1e-06

2022-12-19 11:58:55,919 match.py setupTemplates 278 simulation took 0.4005293846130371

2022-12-19 11:58:56,287 match.py setupTemplates 335 simulation final took 0.32715702056884766

2022-12-19 11:58:56,339 loggerwriter.py write 10 Traceback (most recent call last):



2022-12-19 11:58:56,339 loggerwriter.py write 10   File "C:\Users\anaconda3\lib\site-packages\CADETMatch\match.py", line 375, in <module>



2022-12-19 11:58:56,340 loggerwriter.py write 10     

2022-12-19 11:58:56,341 loggerwriter.py write 10 main(map_function=map_function)

2022-12-19 11:58:56,341 loggerwriter.py write 10   File "C:\Users\anaconda3\lib\site-packages\CADETMatch\match.py", line 26, in main



2022-12-19 11:58:56,342 loggerwriter.py write 10     

2022-12-19 11:58:56,342 loggerwriter.py write 10 setup(cache, path, map_function)

2022-12-19 11:58:56,342 loggerwriter.py write 10   File "C:\Users\anaconda3\lib\site-packages\CADETMatch\match.py", line 112, in setup



2022-12-19 11:58:56,343 loggerwriter.py write 10     

2022-12-19 11:58:56,344 loggerwriter.py write 10 setupDeap(cache, map_function)

2022-12-19 11:58:56,344 loggerwriter.py write 10   File "C:\Users\anaconda3\lib\site-packages\CADETMatch\match.py", line 348, in setupDeap



2022-12-19 11:58:56,346 loggerwriter.py write 10     

2022-12-19 11:58:56,346 loggerwriter.py write 10 cache.search[searchMethod].setupDEAP(

2022-12-19 11:58:56,347 loggerwriter.py write 10 AttributeError

2022-12-19 11:58:56,347 loggerwriter.py write 10 : 

2022-12-19 11:58:56,347 loggerwriter.py write 10 module 'search.unsga3' has no attribute 'setupDEAP'

2022-12-19 11:58:56,347 util.py info 54 process shutting down

Exception ignored in: <function Pool.__del__ at 0x0000022915ADDCA0>

Traceback (most recent call last):

  File "C:\Users\anaconda3\lib\multiprocessing\pool.py", line 268, in __del__

  File "C:\Users\anaconda3\lib\multiprocessing\queues.py", line 372, in put

AttributeError: 'NoneType' object has no attribute 'dumps'

The conda package is pretty old at this point. What I would try doing is.

conda remove cadetmatch cadet cadet-python
pip install cadetmatch

Hello,

I had the same problem as the author of this thread. After updating like heymann suggested I got the following error


2023-01-18 18:39:08,253 match.py print_version 121 CADETMatch starting up version: 0.8.15

2023-01-18 18:39:08,318 match.py print_version 150 attrs version: 22.2.0 tested with 21.2.0

2023-01-18 18:39:08,320 match.py print_version 150 joblib version: 1.2.0 tested with 1.0.1

2023-01-18 18:39:08,322 match.py print_version 150 addict version: 2.4.0 tested with 2.4.0

2023-01-18 18:39:08,324 match.py print_version 150 corner version: 2.2.1 tested with 2.2.1

2023-01-18 18:39:08,326 match.py print_version 150 emcee version: 3.1.3 tested with 3.0.2

2023-01-18 18:39:08,330 match.py print_version 150 SALib version: 1.4.7 tested with 1.3.11

2023-01-18 18:39:08,333 match.py print_version 150 psutil version: 5.9.4 tested with 5.8.0

2023-01-18 18:39:08,335 match.py print_version 150 numpy version: 1.21.6 tested with 1.21.1

2023-01-18 18:39:08,337 match.py print_version 150 openpyxl version: 3.0.10 tested with 3.0.7

2023-01-18 18:39:08,348 match.py print_version 150 scipy version: 1.10.0 tested with 1.7.0

2023-01-18 18:39:08,351 match.py print_version 150 matplotlib version: 3.6.3 tested with 3.4.2

2023-01-18 18:39:08,354 match.py print_version 150 pandas version: 1.5.2 tested with 1.3.0

2023-01-18 18:39:08,356 match.py print_version 150 h5py version: 3.6.0 tested with 3.3.0

2023-01-18 18:39:08,358 match.py print_version 150 cadet-python version: 0.14 tested with 0.11

2023-01-18 18:39:08,361 match.py print_version 150 seaborn version: 0.12.2 tested with 0.11.1

2023-01-18 18:39:08,364 match.py print_version 150 scikit-learn version: 1.2.0 tested with 0.24.2

2023-01-18 18:39:08,366 match.py print_version 150 jstyleson version: 0.0.2 tested with 0.2.0

2023-01-18 18:39:08,368 match.py print_version 150 filelock version: 3.4.2 tested with 3.0.12

2023-01-18 18:39:08,370 match.py print_version 150 pymoo version: 0.6.0.1 tested with 0.4.2.2

2023-01-18 18:39:11,325 util.py setupSimulation 1255 dextran_reference.h5 abstol=1e-06  reltol=1e-06

2023-01-18 18:39:11,494 match.py setupTemplates 284 simulation took 0.16728901863098145

2023-01-18 18:39:11,811 match.py setupTemplates 341 simulation final took 0.22404956817626953

2023-01-18 18:39:12,138 gradFD.py create_template 50 grad simulation took 0.1981973648071289

2023-01-18 18:39:12,138 gradFD.py create_template 52 grad D:/Studium/MA Runde 2/02a Simulationen/CADET-Tutorial/08_CADET-Match_Introduction/results/misc/template_dextran_grad.h5 abstol=1e-06  reltol=1e-06

2023-01-18 18:39:12,187 loggerwriter.py write 10 Traceback (most recent call last):



2023-01-18 18:39:12,187 loggerwriter.py write 10   File "C:\ProgramData\Anaconda3\lib\site-packages\CADETMatch\match.py", line 363, in <module>



2023-01-18 18:39:12,187 loggerwriter.py write 10     

2023-01-18 18:39:12,187 loggerwriter.py write 10 main(map_function=map_function)

2023-01-18 18:39:12,187 loggerwriter.py write 10   File "C:\ProgramData\Anaconda3\lib\site-packages\CADETMatch\match.py", line 28, in main



2023-01-18 18:39:12,188 loggerwriter.py write 10     

2023-01-18 18:39:12,188 loggerwriter.py write 10 hof = evo.run(cache)

2023-01-18 18:39:12,188 loggerwriter.py write 10   File "C:\ProgramData\Anaconda3\lib\site-packages\CADETMatch\evo.py", line 153, in run



2023-01-18 18:39:12,190 loggerwriter.py write 10     

2023-01-18 18:39:12,190 loggerwriter.py write 10 return cache.search[searchMethod].run(cache)

2023-01-18 18:39:12,190 loggerwriter.py write 10   File "C:\ProgramData\Anaconda3\lib\site-packages\CADETMatch\search\nsga3.py", line 9, in run



2023-01-18 18:39:12,190 loggerwriter.py write 10     

2023-01-18 18:39:12,190 loggerwriter.py write 10 return CADETMatch.pymoo_config.run(cache, 'nsga3')

2023-01-18 18:39:12,190 loggerwriter.py write 10   File "C:\ProgramData\Anaconda3\lib\site-packages\CADETMatch\pymoo_config.py", line 172, in run



2023-01-18 18:39:12,192 loggerwriter.py write 10     

2023-01-18 18:39:12,192 loggerwriter.py write 10 algorithm = get_algorithm(alg, ref_dirs=ref_dirs, sampling=init_pop, pop_size=populationSize )

2023-01-18 18:39:12,193 loggerwriter.py write 10   File "C:\ProgramData\Anaconda3\lib\site-packages\pymoo\factory.py", line 32, in get_algorithm



2023-01-18 18:39:12,194 loggerwriter.py write 10     

2023-01-18 18:39:12,194 loggerwriter.py write 10 raise Exception("The method `get_algorithm` has been deprecated since 0.6.0\n"

2023-01-18 18:39:12,194 loggerwriter.py write 10 Exception

2023-01-18 18:39:12,194 loggerwriter.py write 10 : 

2023-01-18 18:39:12,194 loggerwriter.py write 10 The method `get_algorithm` has been deprecated since 0.6.0

Please use the object-oriented interface.

2023-01-18 18:39:12,194 util.py info 54 process shutting down

It seems like the new Cadetmatch version is using a deprecated function get_algorithm.
How can i fix this?

I am using pymoo version 0.6.0.1 and cadetmatch version 0.8.15

CADETMatch does not work with pymoo 0.6 yet. I should have it updated over the weekend. Install pymoo 0.5.0 should fix the problem.

I have released version 0.8.16 now of CADETMatch and it works with PyMoo 0.6 so you should be able to update with

pip install -U cadetmatch

and everything should work.

1 Like

Hello,

I have encountered the same problem today.
Following the method to install 0.8.16 CADET, pymoo and get_algorithm issues are fixed.
But now I cannot see the plot after running match.plot_best()
It only shows the table with the best score.

I traced back to the simulation, and see module error from openpyxl

2023-01-23 17:30:17,768 loggerwriter.py write 10 from openpyxl.workbook import Workbook

2023-01-23 17:30:17,768 loggerwriter.py write 10 ModuleNotFoundError

2023-01-23 17:30:17,768 loggerwriter.py write 10 :

2023-01-23 17:30:17,769 loggerwriter.py write 10 No module named ‘openpyxl’

Could you advise on how to solve this issue?

Hmm openpyxl was not installed.

pip install openpyxl

or

conda install openpyxl

Thanks. It seems to work as intended.

Hi I have done following the recommands. But there is a new problem about the module ‘deap’. I have used with the latest version ‘deap 1.3.3’ . Later I have tried using ‘deap 1.3.1’ but it also didn’t work.

How can I fix the problem?

2023-01-23 16:58:04,709 match.py print_version 121 CADETMatch starting up version: 0.8.16

2023-01-23 16:58:04,725 match.py print_version 150 attrs version: 21.4.0 tested with 21.2.0

2023-01-23 16:58:04,725 match.py print_version 150 joblib version: 1.1.0 tested with 1.0.1

2023-01-23 16:58:04,725 match.py print_version 150 addict version: 2.4.0 tested with 2.4.0

2023-01-23 16:58:04,740 match.py print_version 150 corner version: 2.2.1 tested with 2.2.1

2023-01-23 16:58:04,740 match.py print_version 150 emcee version: 3.1.3 tested with 3.0.2

2023-01-23 16:58:04,740 match.py print_version 150 SALib version: 1.4.7 tested with 1.3.11

2023-01-23 16:58:04,740 match.py print_version 150 psutil version: 5.9.0 tested with 5.8.0

2023-01-23 16:58:04,756 match.py print_version 150 numpy version: 1.21.5 tested with 1.21.1

2023-01-23 16:58:04,756 match.py print_version 150 openpyxl version: 3.0.10 tested with 3.0.7

2023-01-23 16:58:04,756 match.py print_version 150 scipy version: 1.9.1 tested with 1.7.0

2023-01-23 16:58:04,756 match.py print_version 150 matplotlib version: 3.5.2 tested with 3.4.2

2023-01-23 16:58:04,756 match.py print_version 150 pandas version: 1.4.4 tested with 1.3.0

2023-01-23 16:58:04,756 match.py print_version 150 h5py version: 3.6.0 tested with 3.3.0

2023-01-23 16:58:04,774 match.py print_version 150 cadet-python version: 0.14 tested with 0.11

2023-01-23 16:58:04,777 match.py print_version 150 seaborn version: 0.11.2 tested with 0.11.1

2023-01-23 16:58:04,779 match.py print_version 150 scikit-learn version: 1.0.2 tested with 0.24.2

2023-01-23 16:58:04,779 match.py print_version 150 jstyleson version: 0.0.2 tested with 0.2.0

2023-01-23 16:58:04,779 match.py print_version 150 filelock version: 3.6.0 tested with 3.0.12

2023-01-23 16:58:04,788 match.py print_version 150 pymoo version: 0.6.0.1 tested with 0.6.0.1

2023-01-23 16:58:09,996 util.py setupSimulation 1255 dextran_reference.h5 abstol=1e-06  reltol=1e-06

2023-01-23 16:58:10,266 match.py setupTemplates 284 simulation took 0.26996684074401855

2023-01-23 16:58:10,560 match.py setupTemplates 341 simulation final took 0.24327898025512695

2023-01-23 16:58:10,877 gradFD.py create_template 50 grad simulation took 0.2390761375427246

2023-01-23 16:58:10,877 gradFD.py create_template 52 grad D:/MA/My_Programm/CADET-Tutorial/08_CADET-Match_Introduction/results/misc/template_dextran_grad.h5 abstol=1e-06  reltol=1e-06

2023-01-23 16:58:10,893 loggerwriter.py write 10 Traceback (most recent call last):



2023-01-23 16:58:10,893 loggerwriter.py write 10   File "C:\Users\youwu\anaconda3\lib\site-packages\CADETMatch\match.py", line 363, in <module>



2023-01-23 16:58:10,893 loggerwriter.py write 10     

2023-01-23 16:58:10,893 loggerwriter.py write 10 main(map_function=map_function)

2023-01-23 16:58:10,893 loggerwriter.py write 10   File "C:\Users\anaconda3\lib\site-packages\CADETMatch\match.py", line 28, in main



2023-01-23 16:58:10,893 loggerwriter.py write 10     

2023-01-23 16:58:10,893 loggerwriter.py write 10 hof = evo.run(cache)

2023-01-23 16:58:10,893 loggerwriter.py write 10   File "C:\Users\youwu\anaconda3\lib\site-packages\CADETMatch\evo.py", line 153, in run



2023-01-23 16:58:10,893 loggerwriter.py write 10     

2023-01-23 16:58:10,893 loggerwriter.py write 10 return cache.search[searchMethod].run(cache)

2023-01-23 16:58:10,893 loggerwriter.py write 10   File "C:\Users\anaconda3\lib\site-packages\CADETMatch\search\unsga3.py", line 9, in run



2023-01-23 16:58:10,893 loggerwriter.py write 10     

2023-01-23 16:58:10,893 loggerwriter.py write 10 return CADETMatch.pymoo_config.run(cache, 'unsga3')

2023-01-23 16:58:10,893 loggerwriter.py write 10   File "C:\Users\anaconda3\lib\site-packages\CADETMatch\pymoo_config.py", line 121, in run



2023-01-23 16:58:10,893 loggerwriter.py write 10     

2023-01-23 16:58:10,893 loggerwriter.py write 10 cp = pickle.load(cp_file)

2023-01-23 16:58:10,893 loggerwriter.py write 10 AttributeError

2023-01-23 16:58:10,893 loggerwriter.py write 10 : 

2023-01-23 16:58:10,893 loggerwriter.py write 10 Can't get attribute 'Individual' on <module 'deap.creator' from 'C:\\Users\\anaconda3\\lib\\site-packages\\deap\\creator.py'>

2023-01-23 16:58:10,893 util.py info 54 process shutting down

It looks like you have a checkpoint from a previous version of CADET-Match that the system is trying to use. CADET-Match has not used deap for a fair while now. Checkpoints are automatically created so that if an optimization crashes it can be resumed.

There should be a results directory that can be removed and then this should work.

Hi Heyman,

I have done following recommended steps, i.e., cadetmatch version 0.8.16, pymoo 0.6.0.1, cadet-python 0.14. I am getting same type error like you_5.
float type object is not iterable. Then process shutdown like you_5.

Thanks and Regards

Shyama

Thanks! Working well now.

thanks!! it works while removing the result ordner under the path ‘D:/MA/My_Programm/CADET-Tutorial/08_CADET-Match_Introduction/results/’

Thanks team. Now it is working well.

Hi there, I seem to have the same problem. I ran through the Cadet tutorial without problems, but when it comes to cadet match, the Cadet.cadet_path is not found
cadet match is the newest version, as well as cadet-python

utils.ipynb doesn’t give an error:


install_path = 'C:/BITrusted/BitbucketProjects/cadet/cadet'

executable = 'cadet-cli.exe'
if install_path is None:
    try:
        if platform.system() == 'Windows':
            executable += '.exe'
        executable_path = Path(shutil.which(executable))
    except TypeError:
        raise FileNotFoundError(
            "CADET could not be found. Please set an install path"
        )
    install_path = executable_path.parent.parent

install_path = Path(install_path)
cadet_bin_path = install_path / "bin" / executable

if cadet_bin_path.exists():
    Cadet.cadet_path = cadet_bin_path
else:
    raise FileNotFoundError(
        "CADET could not be found. Please check the path"
    )

but cadet match does…

Any idea what I’m missing?

Cheers,
Anja

never mind. I just re-installed evrything in a new env and it finally works

1 Like