Traceback (most recent call last): File "E:\pycharm2018\lib\site-packages\pymoo\core\problem.py", line 285, in _format_dict v = v.reshape(shape[name]) ValueError: cannot reshape array of size 23800 into shape (200,114) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "E:\demo\nsga3_pymoo_check.py", line 568, in <module> X, F = getPlotData("checkpoints/checkpoint_NSGA2_"+str(n)) File "E:\demo\nsga3_pymoo_check.py", line 551, in getPlotData res = minimize(problem, File "E:\pycharm2018\lib\site-packages\pymoo\optimize.py", line 67, in minimize res = algorithm.run() File "E:\pycharm2018\lib\site-packages\pymoo\core\algorithm.py", line 141, in run self.next() File "E:\pycharm2018\lib\site-packages\pymoo\core\algorithm.py", line 161, in next self.evaluator.eval(self.problem, infills, algorithm=self) File "E:\pycharm2018\lib\site-packages\pymoo\core\evaluator.py", line 69, in eval self._eval(problem, pop[I], evaluate_values_of, **kwargs) File "E:\pycharm2018\lib\site-packages\pymoo\core\evaluator.py", line 90, in _eval out = problem.evaluate(X, return_values_of=evaluate_values_of, return_as_dictionary=True, **kwargs) File "E:\pycharm2018\lib\site-packages\pymoo\core\problem.py", line 187, in evaluate _out = self.do(X, return_values_of, *args, **kwargs) File "E:\pycharm2018\lib\site-packages\pymoo\core\problem.py", line 232, in do out = self._format_dict(out, len(X), return_values_of) File "E:\pycharm2018\lib\site-packages\pymoo\core\problem.py", line 287, in _format_dict raise Exception( Exception: ('Problem Error: G can not be set, expected shape (200, 114) but provided (200, 119)', ValueError('cannot reshape array of size 23800 into shape (200,114)')) 是什么意思
时间: 2023-08-11 18:08:11 浏览: 242
这个错误提示说明在你的代码中出现了一个异常。具体来说,问题出在 `pymoo` 库的 `problem.py` 文件的第 285 行,代码尝试对一个大小为 23800 的数组进行重新塑形,但指定的目标形状为 (200, 114)。
根据错误提示,你提供的数据维度与期望的维度不匹配,因此无法进行重新塑形操作。你需要检查你的代码,确保提供的数据与期望的维度一致。
这个错误可能是由于数据的尺寸错误、索引计算错误或者其他相关问题引起的。你可以检查以下几个方面来解决这个问题:
1. 检查数据维度:确认你传递给 `pymoo` 库的数据维度是正确的,特别是与期望的维度匹配。
2. 检查索引计算:如果你在代码中使用了索引计算,例如使用 `get1DIndexBy3DIndex()` 函数,请确保索引计算是正确的,不会导致数组越界或维度不匹配。
3. 检查数据处理过程:检查你对数据进行处理的过程,确保没有错误地改变了数据的尺寸或形状。
如果你能提供更多的代码和上下文信息,我可以帮助你更具体地解决这个问题。
相关问题
Exception in Tkinter callback Traceback (most recent call last): File "D:\Python3.8.5\lib\tkinter\__init__.py", line 1883, in __call__ return self.func(*args) File "D:\PyCharm\pycharm codes\venv\lib\site-packages\retrying.py", line 56, in wrapped_f return Retrying(*dargs, **dkw).call(f, *args, **kw) File "D:\PyCharm\pycharm codes\venv\lib\site-packages\retrying.py", line 266, in call raise attempt.get() File "D:\PyCharm\pycharm codes\venv\lib\site-packages\retrying.py", line 301, in get six.reraise(self.value[0], self.value[1], self.value[2]) File "D:\PyCharm\pycharm codes\venv\lib\site-packages\six.py", line 719, in reraise raise value File "D:\PyCharm\pycharm codes\venv\lib\site-packages\retrying.py", line 251, in call attempt = Attempt(fn(*args, **kwargs), attempt_number, False) File "D:\PyCharm\pycharm codes\VIP音乐破解使用方法\VIP音乐爬虫.py", line 137, in get_KuWoMusic songs_data = self.response_data['data']['list'] KeyError: 'data'
根据提供的错误信息,出现了一个 KeyError 错误。错误提示在访问字典中的键时,不到名为 'data' 的键。这可能是因为你正在尝试访问一个不存在的键或者键名大小写不匹配。
请检查你的代码,确保在访问字典中的键时使用了正确的键名,并确保键名的大小写与字典中的一致。如果需要更多帮助,请提供更多相关的代码或上下文信息。
E:\pycharm\Python-3.9.0\Scripts>pip install open3d Traceback (most recent call last): File "e:\pycharm\python-3.9.0\lib\runpy.py", line 193, in _run_module_as_main return _run_code(code, main_globals, None, File "e:\pycharm\python-3.9.0\lib\runpy.py", line 86, in _run_code exec(code, run_globals) File "E:\pycharm\Python-3.9.0\Scripts\pip.exe\__main__.py", line 5, in <module> File "e:\pycharm\python-3.9.0\lib\site-packages\pip\_internal\cli\main.py", line 10, in <module> from pip._internal.cli.autocompletion import autocomplete File "e:\pycharm\python-3.9.0\lib\site-packages\pip\_internal\cli\autocompletion.py", line 10, in <module> from pip._internal.cli.main_parser import create_main_parser File "e:\pycharm\python-3.9.0\lib\site-packages\pip\_internal\cli\main_parser.py", line 9, in <module> from pip._internal.build_env import get_runnable_pip File "e:\pycharm\python-3.9.0\lib\site-packages\pip\_internal\build_env.py", line 19, in <module> from pip._internal.cli.spinners import open_spinner File "e:\pycharm\python-3.9.0\lib\site-packages\pip\_internal\cli\spinners.py", line 9, in <module> from pip._internal.utils.logging import get_indentation File "e:\pycharm\python-3.9.0\lib\site-packages\pip\_internal\utils\logging.py", line 29, in <module> from pip._internal.utils.misc import ensure_dir File "e:\pycharm\python-3.9.0\lib\site-packages\pip\_internal\utils\misc.py", line 37, in <module> from pip._vendor.tenacity import retry, stop_after_delay, wait_fixed File "e:\pycharm\python-3.9.0\lib\site-packages\pip\_vendor\tenacity\__init__.py", line 397, in <module> FutureGenericT = futures.Future[t.Any] TypeError: 'type' object is not subscriptable
看起来您在安装Open3D时遇到了一些错误。该错误看起来是由于pip版本不兼容导致的。
为了解决这个问题,您可以尝试升级pip到最新版本,然后重新安装Open3D。请按照以下步骤进行操作:
1. 打开命令行终端(Windows用户可以使用CMD或PowerShell,Mac和Linux用户可以使用终端)。
2. 运行以下命令来升级pip:
```
python -m pip install --upgrade pip
```
这将使用pip自身来升级到最新版本。
3. 升级完成后,再次运行以下命令来安装Open3D:
```
pip install open3d
```
这将使用最新版本的pip来下载并安装Open3D。
希望通过升级pip并重新安装Open3D能够解决您遇到的问题。如果问题仍然存在,请提供更多错误信息,以便我能够更好地帮助您。
阅读全文