Closed isong29 closed 1 year ago
does commenting out out["G"] = []
solve the issue?
Hi Julian,
It seems like it fixes that error, but adds new errors:
[c:\Users\cfiso\.conda\envs\QSD\lib\site-packages\pymoo\core\problem.py:237](file:///C:/Users/cfiso/.conda/envs/QSD/lib/site-packages/pymoo/core/problem.py:237): FailedEvaluation: [TypeError] list indices must be integers or slices, not str
self._evaluate(X, out, *args, **kwargs)
[c:\Users\cfiso\.conda\envs\QSD\lib\site-packages\pymoo\core\problem.py:237](file:///C:/Users/cfiso/.conda/envs/QSD/lib/site-packages/pymoo/core/problem.py:237): FailedEvaluation: [TypeError] list indices must be integers or slices, not str
self._evaluate(X, out, *args, **kwargs)
and some type of assertion error:
[c:\Users\cfiso\.conda\envs\QSD\lib\site-packages\pymoo\core\termination.py](file:///C:/Users/cfiso/.conda/envs/QSD/lib/site-packages/pymoo/core/termination.py) in update(self, algorithm)
27 else:
28 progress = self._update(algorithm)
---> 29 assert progress >= 0.0
30
31 self.perc = progress
AssertionError:
I'm not quite sure which list it is unable to index, since I do not call a specific index aside from out["F"], which is pre-defined in PyMoo.
Thank you once again for your quick response and help.
Best, Ian
I was not able to reproduce the error. Please provide a minimum working example if you want me to have a look into it.
Hi Julian,
Thank you for your willingness to help looking into this. Would it be OK for me to send this to you via email, or should I attach the full code here?
Thank you, Ian
You can directly attach it here. Please only post a minimum example with the code necessary to reproduce the error though (not your entire file).
Hi Julian,
I actually went through everything and found the issue in my own personal code. So commenting out the ["G"] does help. Thank you very much for your assistance.
Best, Ian
Hi everyone,
Thank you again for the help earlier last week. I am now attempting to run an MOO with a vectorized problem, written as follows:
"BaselineSolve" inside the Problem calls a function that takes in a 2D numpy array where each row is an entry, and each column is a parameter. It outputs a 2D numpy array that is formatted the same way. I.e. the output is:
Where each
Obji
is a 1D np array containing the objective function values for the i-th set of parameters that were inputted into the function.I confirmed this by printing the np.shape() of the input and the output. It shows that
x
has a shape of (40, 3) - which makes sense, 40 population and 3 parameters each) - and that the output of the BaselineSolve function has a shape of (40,2) - which also makes sense since there are 40 individuals and 2 objective functions each.However, at the very end of the evaluation, I run into a numpy error, specifically that:
Have you seen such an error occur? I did look through the other issues on the github, and Julian had mentioned that the output should be of shape
(len(x), n_obj)
, which in this case it is.Thank you very much for your assistance in this matter.
Best, Ian