Comments (10)
No really feel free to ask questions. I am closing this issue, but feel free to re-open if needed.
We will work on the remaining issues (#197 and #215).
If your usecase mandates parameter inference, we will soon propose ensemble (differential and affine avariant) mcmc sampler.
from flepimop.
Hi Jeff, can you check that you have your paths to the directories where the code is set up correctly? You might have one too many levels of "flepimop"? This line seems to be finding your config correctly, which means you must be correctly in the project path directory. But then it's going to look for gempyor in $FLEPI_PATH/flepimop/gempyor_pkg
ie $/Users/jbs82/Documents/dev/flepimop/flepiMoP/flepimop/gempyor_pkg
. Is that where you have it? And did you open R and install all the required packages and make sure there were no errors?
Also (separate issue), if you are running the config config_sample_2pop_inference.yml
it would be easier if you move it out of the config library into the PROJECT_PATH
directory (ie right into flepimop_sample
), because otherwise file paths within it might not work. I will add a note on this to the documentation - we just keep configs in that subdirectory so it's more organized but should be moved out to be run.
Thanks for trying things out and please report any other issues you encounter here - we are still very much a work in progress of making things functionally accessible to others!
from flepimop.
Thanks for your quick reply.
correct...
$FLEPI_PATH/flepiMoP/flepimop/gempyor_pkg/ is equivalent to /Users/jbs82/Documents/dev/flepimop/flepiMoP/flepimop/gempyor_pkg/
I didn't have any issues with R installation, nor the libraries, in terms of the listed instructions. I had issues with curl, and I am working on a mac, so with arrow. But those were resolved and eventually didn't have any errors.
Yes, I did copy config_sample_2pop_inference.yml into the project_path.
I will move my FLEPIMOP_PATH in the morning and retry.
Thank you very much for your help. It is appreciated.
from flepimop.
Hey Jeff,
Either gempyor is not installed, or it is installed but not in the python environment that reticulate
(the R package that interfaces with python) sees:
Can you try to run python
in a command line and do:
import gempyor
in the prompt that you get? you will either get an error or nothing (which means that gempyor is installed).
If you get an error, can you retry the installation step of gempyor with pip ?
If you don't get an error there, in R this time (either from Rstudio or typing R in the command line)
library(reticulate)
gempyor <- reticulate::import("gempyor")
does this snippet works? if not try adding reticulate::use_python(Sys.which('python'),require=TRUE)
or for a conda environment: reticulate::use_condaenv('flepimop-env')
Let us know what error and output you encounter with these steps, and thanks for your patience as we are improving the flepiMoP installation.
from flepimop.
Good morning. Thanks for your advice.
I could not import gempyor using python (version 3.12) which was set as my default. Changing to python3.11 libraries I was able to import gempyor. Maybe an issue with my 3.12 install?
I then created ~/.Renviron and specified: RETICULATE_PYTHON="/usr/local/bin/python3.11".
After restarting R, it was showing python as python3.11.
I ran the Inference run and it proceeded past the gempyor issue.
I then ran into the arrow issue our R person warned me about (which is a mac issue).
Error in parquet___WriterProperties___Builder__create() :
Cannot call parquet___WriterProperties___Builder__create(). See https://arrow.apache.org/docs/r/articles/install.html for help installing Arrow C++ libraries.
After contacting her and going back and forth a bit, she had me...
install.packages("arrow", repos = c("https://apache.r-universe.dev", "https://cran.r-project.org"))
this got me past the arrow issue.
Received a whole host of Integration errors, and after those the following...
Integration error: rhs got a negative x (pos, time) (array([ 3, 10, 11]),) 213.0
Integration error: transition amounts negative (trans_idx, node) 0 0
Integration error: transition amounts negative (trans_idx, node) 0 1
Integration error: transition amounts negative (trans_idx, node) 1 1
213it [00:03, 69.53it/s]
CRITICAL:root:Integration error: negative values detected in epidemic integration result. Failing...
CRITICAL:root:Saving run configuration due to integration error
load the name space with:
with open('integration_dump.pkl','rb') as fn_dump:
states, states_daily_incid, ncompartments, nspatial_nodes, ndays, parameters, dt, transitions, proportion_info, transition_sum_compartments, initial_conditions, seeding_data, seeding_amounts, mobility_data, mobility_row_indices, mobility_data_indices, population, stochastic_p, method = pickle.load(fn_dump)
/!\ Invalid integration, will cause problems for downstream users /!\
INFO:root:[SEIR.compute] completed in 3.09 s
INFO:root:[SEIR.postprocess] completed in 0.01 s
INFO:root:[onerun_delayframe_outcomes.compute] completed in 0.03 s
INFO:root:[onerun_delayframe_outcomes.postprocess] completed in 0.01 s
INFO:root:[>>> GEMPYOR onesim (loading file)] completed in 3.19 s
[1] "Current likelihood -2118.26 Proposed likelihood -2118.26"
[1] "**** GLOBAL ACCEPT (Recording) ****"
[1] "by default because it's the first iteration of a block 1"
[1] "Resetting chimeric values to global due to global acceptance"
[1] "Last accepted index is 1"
[1] "Time to run MCMC iteration 1 of slot 1 is 3.34 seconds"
[1] "Copying latest global files to final"
Error: File copy failed:FALSE seed_gf |TRUE init_gf |TRUE seir_gf |TRUE hosp_gf |TRUE llik_gf |TRUE snpi_gf |TRUE hnpi_gf |TRUE spar_gf |TRUE hpar_gf |FALSE seed_block |TRUE init_block |TRUE seir_block |TRUE hosp_block |TRUE llik_block |TRUE snpi_block |TRUE hnpi_block |TRUE spar_block |TRUE hpar_block |
/usr/local/Cellar/[email protected]/3.11.9/Frameworks/Python.framework/Versions/3.11/lib/python3.11/multiprocessing/resource_tracker.py:254: UserWarning: resource_tracker: There appear to be 1 leaked semaphore objects to clean up at shutdown
warnings.warn('resource_tracker: There appear to be %d '
Error in unserialize(socklist[[n]]) : error reading from connection
Calls: %dopar% ... recvOneData -> recvOneData.SOCKcluster -> unserialize
Execution halted
Just got here a few minutes ago and have not looked into this at all yet.
from flepimop.
That's a good call. There is an issue with this config.
- The bounds the inference engines see for modifiers Ro_mod and Ro_lockdown (a and b) are between [-1, 1], which means that these multipliers can become negatives (so the transition with
rate: ["Ro * gamma"]
has a negative rate, which causes transition error.
Can you retry changing the a
bound to zero? if that works, then we'll fix the config on our side. Sorry about that.
In the mean time, I opened an issue to make a clearer error message for this error: we should detect negative transition rates before the integration engine fails.
One more thing, as I see that you are building a containerized version, we are currently developing a full-python inference engine (see branch new_inference and pull request #203) which will be much easier to package (single pip line to install). That's in alpha at the moment.
from flepimop.
I just updated the config_sample_2pop_inference.yml
so you should just pull flepimop_sample again to retry
from flepimop.
I appreciate the update. Thank you.
Latest run...
INFO:root:[>>> GEMPYOR onesim (loading file)] completed in 3.50 s
[1] "Current likelihood -2248.62 Proposed likelihood -2248.62"
[1] "**** GLOBAL ACCEPT (Recording) ****"
[1] "by default because it's the first iteration of a block 1"
[1] "Resetting chimeric values to global due to global acceptance"
[1] "Last accepted index is 1"
[1] "Time to run MCMC iteration 1 of slot 1 is 3.64 seconds"
[1] "Copying latest global files to final"
Error: File copy failed:FALSE seed_gf |TRUE init_gf |TRUE seir_gf |TRUE hosp_gf |TRUE llik_gf |TRUE snpi_gf |TRUE hnpi_gf |TRUE spar_gf |TRUE hpar_gf |FALSE seed_block |TRUE init_block |TRUE seir_block |TRUE hosp_block |TRUE llik_block |TRUE snpi_block |TRUE hnpi_block |TRUE spar_block |TRUE hpar_block |
/usr/local/Cellar/[email protected]/3.11.9/Frameworks/Python.framework/Versions/3.11/lib/python3.11/multiprocessing/resource_tracker.py:254: UserWarning: resource_tracker: There appear to be 1 leaked semaphore objects to clean up at shutdown
warnings.warn('resource_tracker: There appear to be %d '
Error in unserialize(socklist[[n]]) : error reading from connection
Calls: %dopar% ... recvOneData -> recvOneData.SOCKcluster -> unserialize
Execution halted
If you full output would be more helpful, just let me know. Or if there is any other info I can provide which could prove helpful.
Best,
Jeff
from flepimop.
Sorry, I just asked and this error is not a "real" error (see issue #197). The program has finished to run and is checking for files to exist. Apparently theses check are not up to date with the new file structure so it fails even though it should not.
We will fix this asap, in the meantime you can safely discard this error and consider that inference slot has successfuly completed.
from flepimop.
Sorry, I should have considered doing a search on that issue. My apologies.
Glad to hear it's not a concern. I very much appreciate your assistance.
Best,
Jeff
from flepimop.
Related Issues (20)
- Options for file saving including intermediate SEIR, HOSP files HOT 2
- Write Unit Tests for R Packages
- Write Unit Tests for inference_slot.R and inference_main.R
- Inference slot shows error when copying if files don't exist HOT 1
- Inference file writing HOT 5
- Build Round 18 Config
- Decide on how to account for high risk population vacc HOT 2
- Define compartment structure HOT 3
- sunset calls to create_seeding.R within inference HOT 1
- Detect negative rate and give a nice error when that happens
- Support smoothing of modifiers HOT 1
- Quick Start Guide/Flepimop_sample and data_path section no longer supported HOT 4
- Write validation check on config HOT 4
- Move the flepimop sample to the main repo under `examples/`, and make them run as integration test HOT 1
- Allow merging with only one reviewer with code owner
- Complete The "Inference Model Output" Section In Gitbook Documentation HOT 2
- Integration of website/documentation/sample/code GitHub repos HOT 2
- Missing dependencies for installation of necessary R packages on Ubuntu 22.04 HOT 5
- Place link to documentation "Running locally in a conda environment" in a more easily-noticeable location
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 flepimop.