-
Notifications
You must be signed in to change notification settings - Fork 9
NSGA-II parallel Error in { : task 2 failed - "only 0's may be mixed with negative subscripts" #16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Ok, I understand that it could be due to the genetic operator of selection. Could you provide more information to replicate the problem? Depending on the type of chromosome used (
As another solution, you could modify the genetic operator causing the problem and pass it as a parameter to the |
Thank you for your response. I’m running with type="real-valued". Unfortunately, it’s difficult to provide reproducible code, as it seems the parallelization is not applying the seed I set. The results vary each time I run it, and the iteration at which the error occurs also changes. I’ve encountered the same error around iterations 200, 500, and 800, which is quite strange. What’s even more odd is that only one CPU core reports the error. I’m not familiar with using debug mode to trace back to the corresponding core and pinpoint the environment variables at the time, so I’m unable to locate exactly which number is causing the issue. If you have any suggestions or advice on how to approach this, it would be greatly appreciated. I also ran the non-parallelized NSGA-II with the same data and settings. I ran it nearly 20 times, and not once did it result in an error—it ran successfully every time. Therefore, I can’t provide the environment variables from the error scenario. I’ve forked the rmoo package, and I’ll try to investigate the cause of the issue and modify the source code. If I manage to find a solution, I will definitely report it back to you, as I believe it could be valuable for the package. I truly enjoy using rmoo—it’s a very interesting R package. If you have already solved this issue, I’m looking forward to your update! |
Description:
I am using the rmoo package (version 0.3.0) to run the NSGA-II optimization with parallelization (using function
rmoo
). The error occurs during the execution when the iteration reaches 503:Error in { :
task 2 failed - "only 0's may be mixed with negative subscripts"
I have checked my fitness function, and it does not seem to cause the issue. I suspect that the problem might be related to illegal indexing during the selection of offspring, such as when negative indices are mixed with positive ones. For example, I get the same error when running the following in R:
c(1, 2, 3)[c(-1, 2)]
This results in the error:
Error in c(1, 2, 3)[c(-1, 2)] :
only 0's may be mixed with negative subscripts
It appears that somewhere in the process, an illegal index like c(5, -1, -2) is being generated, which could be causing the issue.
Additional Information:
rmoo version: 0.3.0
OS: Windows 11
The text was updated successfully, but these errors were encountered: