简体   繁体   English

Platypus NSGA-II 显示 '' unhashable type: 'numpy.ndarray' '',经过 200 次评估

[英]Platypus NSGA-II shows '' unhashable type: 'numpy.ndarray' '', after 200 evaluations

I am implementing an NSGA-II using Platypus.我正在使用鸭嘴兽实现 NSGA-II。 I am not able to show all my code, but I have close to 30 decision variables, 2 objectives, 1 constraint.我无法展示我所有的代码,但我有近 30 个决策变量、2 个目标、1 个约束。

It would run smoothly for the first 200 evaluations of the function, but then returns the error:对于 function 的前 200 次评估,它将顺利运行,但随后返回错误:

TypeError: unhashable type: 'numpy.ndarray' TypeError:不可散列的类型:'numpy.ndarray'

I reckon it is because the way NSGA-II is implemented by Platypus, as each generation consists of 100 population and 200 corresponds to 2 generations of iteration.我认为这是因为 NSGA-II 是 Platypus 实现的方式,因为每一代由 100 个种群组成,200 个对应于 2 代迭代。 But what reasons would make this error appear at the 3rd generation?但是什么原因会导致这个错误出现在第三代呢?

Think I found the reason myself.我想我自己找到了原因。 It was not because of the Platypus implementation.这不是因为鸭嘴兽的实施。 Instead, I made a mistake by introducing a 'float+list' type objective相反,我通过引入“浮动+列表”类型的目标犯了一个错误

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM