Giter Site home page Giter Site logo

gaia-unil / g2s Goto Github PK

View Code? Open in Web Editor NEW
42.0 3.0 10.0 21.02 MB

A flexible MPS framework

Home Page: https://gaia-unil.github.io/G2S/

License: GNU General Public License v3.0

Makefile 1.97% MATLAB 4.19% C++ 81.57% Python 4.81% Batchfile 0.11% Shell 2.79% R 0.27% Cuda 3.02% Roff 0.62% Ruby 0.66%
mps multiple-point-statistics qs quantile-sampling narrow-distribution-selection simulations nds stochastic training-images texture-synthesis

g2s's Introduction

G2S: The GeoStatistical Server

License: GPL v3

Brief overview

G2S is composed of 2 parts:

  • the first one is a server that manages computations and can be compiled for each hardware to obtain optimal performance.
  • the second part is composed of different interfaces that communicate with the server through ZeroMQ. Interfaces can be added for each software. Similarly, G2S can be extended for any other geostatistical simulation algorithm.

Currently the G2S interface is available for MATLAB and Python. G2S is provided with both simulation algorithms QS (QuickSampling) and NDS (Narrow Distribution Selection).

G2S is currently only available for UNIX-based systems, Linux and macOS. A solution for Windows 10+ is provided using WSL (Windows Subsystem for Linux). However, for previous Windows versions, the only solution currently available is to install a Linux system manually inside a virtual machine.

Documentation

An interactive and complete documentation is available here.

Online Demo (Back! but slow)

An interactive online version is available here, to experiment with small unconditional simulations.

g2s's People

Contributors

alecomunian avatar gregoiremariethoz avatar mgravey avatar pauwiersma avatar rafnuss avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

g2s's Issues

Compiling on Ubuntu 18.04 LTS

When I compile the Matlab interface I using 'CompileG2S' I get an error that "json/json.h" cannot be found, in the line
#include <json/json.h>

If I add the following soft link the compilation works fine

sudo ln -s /usr/include/jsoncpp/json/ /usr/include/json

I use Ubuntu 18.04.3 LTS

  • Thomas

failed to do simulation or return simulation results

Hello there,

I downloaded and compiled c++ and python. They both seemed to work. I can launch server and get return from g2s import g2s; g2s('--version') as "G2S version 0.98.002, compiled the Mar 20 2022 15:34:39 with Python 3.8.12".

However, when I run example codes, i.e. unconditionalSimulation.py, data=g2s('-a','qs', '-ti',ti, ...) returns job Id is: 1911726720 and (-0.001, -1.0, 1911726720) as I print(data)
I have checked ti beng downloaded was correctly plotted out on screen after commented out #ax2.imshow(simulation).

I noticed there were one or two bgrid.zip files in ./data but nothing in logs. When stderr of the server was redirected to a file, it contains the following message "can not open file : logs/1911726720.log".

Could you please advise a solution? I did not see an automatic test was carried before compiling client code, but noticed other executables

I compiled g2s on wsl ubuntu 20.04 with gcc/g++ 9.3.0 and all standard settings in makefile but turn-off gpu support for now but noticed codes listed in algosName.config. Could they be used for checking server status?

Thanks,

Jingsheng Ma

Problem with the build process

Describe the bug
Problem with the installation process.
I tried the simple way (pip), but they also didn't work.
The script with gcc apparently goes pretty well, but when installing with pip, I get the error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/joao/miniconda3/envs/dl/lib/python3.8/site-packages/g2s/__init__.py", line 12, in <module>
    from .g2s import run
ImportError: /home/joao/miniconda3/envs/dl/lib/python3.8/site-packages/g2s/g2s.cpython-38-x86_64-linux-gnu.so: undefined symbol: gzrewind

I found that a possible solution was to build the interface/server with the -lz argument in the last position, so I did.
The server build appeared to be successful, but the python interface give the following error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module><br>
  File "/home/joao/bibliotecas/G2S/build/python-build/g2s/__init__.py", line 12, in <module><br>
    from .g2s import run<br>
ModuleNotFoundError: No module named 'g2s.g2s'  

Information

  • interface : Python 3.8.10
  • OS: Ubuntu 20.04
  • 0.97.007 with manual installation and 0.97.7 with pip

To Reproduce
I created a new conda env, cloned the git repository and followed the step-by-step guide (https://gaia-unil.github.io/G2S/) to manual build the server and the python interface.

Test
If possible a small code that reproduce the bug

Expected behavior
Both server's build and interface's build returns no errors and the follow code returns the right version.
from g2s import g2s; g2s('--version')

Additional context
As a somewhat beginner with make and setup.py, I couldn't find a solution to this problem.
Did I do something wrong with the installation process?
The process is apparently very straight-forward and easy, so I probably messed something up…

ValueError: too many values to unpack in python examples

Hello Mathieu! And thank you for sharing your code :-)

I tried all the scripts in the example/python folder, and all of them give:

ValueError: too many values to unpack

the error is always located at the line where you collect the output of g2s, for example like in the script unconditionalSimulation.py at line 13.

simulation, _ =g2s(...

The error can be solved in all the scripts by changing _ into *_, because in this way Python can throw away an undefined number of return values of g2s but the first argument.

This happens on Python 3.10.6.

Hope this helps.
Bests!

Alessandro

'g2s_cuda.so' is missing

Hello,
I have a problem during the installation of G2S on Ubuntu WSL for Windows 10. I am receiving the following message when I install it manually from build/c++-build/install.bat:

make[1]: Entering directory '/mnt/c/Users/EPFL-LHE/Desktop/MPS/G2S-master/build/c++-build'
Creation of /usr/local if needed
cp: cannot stat './g2s_cuda.so': No such file or directory
warning: 'g2s_cuda.so' is missing, this is probably due to the absance of CUDA compiler.
Installation c++ finished!
make[1]: Leaving directory '/mnt/c/Users/EPFL-LHE/Desktop/MPS/G2S-master/build/c++-build'

I have installed CUDA both for Windows 10 and for WSL-Ubuntu, available at this link.
Do you have any idea of what could be causing this missing library? I checked and the GPU is not being used when I run some tests from Matlab 2023.
Thank you very much in advance for your help.
Best,
Clemente Gotelli

Portable GUI-type version for windows, for just texture synthesis

As a beginner coder, im finding it difficult to set up the server portion of the program on WSL and navigate all the parts in different folders.
I have installed with "build/c++-build/install_needs_W_VM.sh" , after migrating from WSL1 to WSL2 (WSL gave me many errors) but running the ./server part does nothing on my end currently, as in nothing happens or opens running this command and no errors.
I'm not sure where to put the examples at the bottom of https://gaia-unil.github.io/G2S/ and how to execute them.
Basically, for me, running https://www.mgravey.com/mps.online/ is great. Being able to load in my own image, and having intuitive sliders for the controls of the output.
It would be of great use if I could emulate the demo (javascript?) on my own machine.
With the same input button, and spots to plug in parameters.
To include all the parameters from all the other options I haven't explored from the examples as well.
I'm only interested in the texture synthesis aspect.
Having it bundled somehow where I could either execute it all in one go, or call it from the powershell would be an ideal workflow.

Also, it seems for the demo there is a limited input size, it seems to be 100x100. I'm curious to know if smaller inputs are possible as well?

Cheers!

Passing None to optional G2S parameters

For flexible use of g2s() in functions etc. it would be handy if you could pass None to the optional parameters (mostly -ki), which is currently not supported. I'm sure there are multiple workarounds to achieve this yourself but being able to pass None would save some effort.

libzmq.so.5 not found

Hello G2S Team,

I tried to install G2S for python on the Bernese supercomputer in my conda environment.

Installing with pip install G2S went fine, but calling it with import G2S is unfortunately giving me:

Traceback (most recent call last):
File "", line 1, in
File "/storage/homefs/mawegmann/.conda/envs/tfgpu/lib/python3.7/site-packages/g2s/init.py", line 12, in
from .g2s import run
ImportError: libzmq.so.5: cannot open shared object file: No such file or directory

It is a UNIX environment where I don't have sudo rights. Any idea on how to approach this issue is appreciated.

All the best,
Martin

How is going with the -adsim simulation?

I have tried with the server, and it is great! Thank you very much!
I am trying to generate a 3D structure from a 2D microscope image of a ceramic. and for now I am using the server to make several simulated images and stack them together. However, the result is not very good for what i have tried.

I read though the documentation and found the -adsim function

| ‑adsim | augmented dimentionality simulation: allows for 3D simulation using 2D training image, only for categories (Comming soon!)

which would be great if it can be used, so just wondering how is going with this function development and want just try the new features :-)

Issue importing G2S for Python

When trying to import g2s into python after installing g2s through pip I get,

from g2s import g2s
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/anaconda3/lib/python3.8/site-packages/g2s/__init__.py", line 12, in <module>
    from .g2s import run
ImportError: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.26' not found (required by /home/anaconda3/lib/python3.8/site-packages/g2s/g2s.cpython-38-x86_64-linux-gnu.so)

After trying to replace the libstdc++.so.6 version with an updated version that contains GLIBCXX_3.4.26, I am still receiving the error.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.