Comments (8)
I failed to mention that I am running pygmo 2.4 on Python 3.6.2 64-bit through Anaconda on Windows 10.
from pagmo2.
Your code is valid and works in our installation.
Maybe you have some installation problems?
How did you install pygmo2?
from pagmo2.
I am uncertain if it was prepackaged with my Anaconda install or if installed using conda install pygmo
.
conda list
shows
pygmo 2.4 np112py36_0 conda-forge
*Edit
According to https://docs.anaconda.com/anaconda/packages/pkg-docs#python-3-6 pygmo is not prepackaged with Anaconda, so install has been through conda install pygmo
*Edit 2
I have uninstalled Python and Anaconda. Installed Miniconda, updated via conda update --all
and installed pygmo with conda install pygmo
. The error is the same as before.
from pagmo2.
@lsangild Can you try to put the last three lines in a main block? Something like this:
if __name__ == "__main__":
prob = pg.problem(sphere_function(3))
algo = pg.algorithm(pg.bee_colony(gen = 20, limit = 20))
archi = pg.archipelago(n=1, algo=algo, prob=prob, pop_size=10)
from pagmo2.
@bluescarni That worked!
Actually I only need to put the archipelago line in a main block.
Can you elaborate on the cause of the issue?
from pagmo2.
@lsangild The first instantiation of an island/archipelago triggers the creation of a pool of processes that do the actual parallel optimisation work when you call evolve()
. These processes need to import
your script in order to "see" the definition of your problem, but if in the import phase of your script you are creating an archipelago then this recursively triggers the creation of another pool of processes, which again will try to import your script, triggering the creation of an archipelago, etc. etc.
See also the first two answers here:
For pygmo, it means in practice that you should not create islands/archipelagos as part of the module code (i.e., the code that gets executed upon importing the module).
from pagmo2.
I renamed the issue for future references.
Can we close this?
from pagmo2.
Thank you for your help 👍
from pagmo2.
Related Issues (20)
- [BUG] mhaco asserts if initial population does not verify constraints
- MinGW installation problem HOT 1
- how to run pagmo2 in parallel cluster? HOT 1
- [BUG] redundant code in moead.cpp HOT 2
- [BUG] Could NOT find pagmo_IPOPT (missing: PAGMO_IPOPT_INCLUDE_DIR) HOT 1
- [BUG] No 2.19.0 tag HOT 2
- [BUG] moead_gen is not documented HOT 2
- [FEATURE] PAGMO_VERSION HOT 2
- Scaling of design variables and
- How to optimize with algorithms::ipopt? HOT 2
- [BUG] Maximize function with Ipopt: incorrect population returned HOT 2
- [BUG] Compilation problem with IPOPT HOT 7
- Question: Use of Hessian with Ipopt
- pagmo-devel 2.19 build 3 not found by meson build system HOT 5
- Passing arguments in a user defined problem HOT 6
- Uninitialized variables may be used in cec2014 problem
- MPI Island class for cluster computing HOT 1
- Avoid multiple definitions of mathematical constants
- No "NaN/infinity" verification in sbx crossover implementation AND no bounds verification for NSGA-II's initial population
- Add NSGA-III implementation
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pagmo2.