-
Notifications
You must be signed in to change notification settings - Fork 67
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
Type error in GCBM API causes (fatal) - main(306) - Value too large.
error.
#136
Comments
Here is the nightly from Jun 22nd: https://github.com/moja-global/FLINT.Cloud/pkgs/container/rest_api_gcbm/26346728 We can work backwards through the builds using bisection to quickly find the previous known working state. |
rest_api_gcbm
builds for (fatal) - main(306) - Value too large.
error.
Here's an earlier description of the problem: #111 (comment) It might be differences in instruction set. @radistoubalidis can we set a specific architecture in our Github Actions? |
@HarshCasper or @Simpleshell3 or @Janvi-Thakkar or @SanjaySinghRajpoot - can you confirm whether the latest I'd like to identify whether the issue is caused by a bug in our software or the environment it's running in. |
rest_api_gcbm
builds for (fatal) - main(306) - Value too large.
error.(fatal) - main(306) - Value too large.
error.
I think I know what's causing this. After checking a few of our old builds, I decided to try revisit the old GCBM Demo Run and found that it worked! Well - it worked after a few tweaks (#165). So with a working reference, I generated the What I found was a teeeny tiny difference in the configuration of every input file. In the diff for --- a/input/run4/Classifier1.json
+++ b/tests/linux-demo/Classifier1.json
@@ -1,21 +1,21 @@
{
"layer_type": "GridLayer",
"layer_data": "Byte",
- "nodata": 255,
+ "nodata": 255.0,
"tileLatSize": 1.0,
"tileLonSize": 1.0,
...
} Type safety is something that's bitten us before with FLINT - I remember @shubhamkarande13 coming up with all sorts of funky work-arounds to send type-safe JSON from the flint-ui. Now that we've got a stronger backend server we should have more control over how the auto-generated JSON gets formatted. Can I please leave it to you to propose a hot-fix for the master branch (L328)? Please let me know if you need help verifying the result. Appreciate your help! P.S. For reference, for any new contributors wondering how to make this change, these are the steps I took to test both simulations: linux-demo# git clone https://github.com/moja-global/flint.cloud
# git checkout linux-test
cd flint.cloud/local/rest_api_gcbm
docker-compose up -d
cd tests
unzip linux-demo.zip
docker exec -it flint.gcbm /bin/bash
# inside the container
cd tests/config
/opt/gcbm/moja.cli --config_file=gcbm_config.cfg --config_provider=provider_config.json run4# git checkout master
unzip GCBM_New_Demo_Run.zip
mv GCBM_New_Demo_Run local/rest_api_gcbm
flint.cloud/local/rest_api_gcbm
# removing `-d` means we see the console log
docker-compose up
# in a new terminal
cd flint.cloud/local/rest_api_gcbm/GCBM_New_Demo_Run
# from curl.md
curl -F disturbances='@disturbances/disturbances_2011_moja.tiff' \
-F disturbances='@disturbances/disturbances_2012_moja.tiff' \
-F disturbances='@disturbances/disturbances_2013_moja.tiff' \
-F disturbances='@disturbances/disturbances_2014_moja.tiff' \
-F disturbances='@disturbances/disturbances_2015_moja.tiff' \
-F disturbances='@disturbances/disturbances_2016_moja.tiff' \
-F disturbances='@disturbances/disturbances_2018_moja.tiff' \
-F classifiers='@classifiers/Classifier1_moja.tiff' \
-F classifiers='@classifiers/Classifier2_moja.tiff' \
-F db='@db/gcbm_input.db' \
-F miscellaneous='@miscellaneous/initial_age_moja.tiff' \
-F miscellaneous='@miscellaneous/mean_annual_temperature_moja.tiff' \
-F title="run4" \
http://localhost:8080/gcbm/upload
# after starting the simulation, watch the container console of first terminal
curl -d "title=run4" -X POST http://localhost:8080/gcbm/dynamic |
I still get the error, I have typecasted all the occurrences to |
Hmm, ok. I'll keep looking. Can you please share a gist (or a patch) showing how you added strong typing to Regarding the error message - it's a bit cryptic, I'm not sure if it means the value is large in memory or numerically. It's a mystery! |
https://github.com/moja-global/FLINT.Cloud/pull/166/files
Alrighty 👀 |
Same, I still get an error. |
I did a detailed diff between @Namyalg's config and the reference simulation and found a small discrepancy. In @Namyalg's API generated copy of @padmajabhol can you please test if this fixes the error for you? If so, that means our type safety needs to be more precise than just casting everything as |
Makes sense. Sure. |
@padmajabhol @Namyalg - were you able to test this fix? |
It doesn't work, we tried setting the values to 32767 in |
Hi, @Namyalg and me went on a meet to discuss this. From what we understood from your previous comment is that, you wanted the We changed it to We might have not processed it the way you think so please correct us here. |
Thanks @padmajabhol and @Namyalg - that's not quite what I meant. The input tiff files are in a variety of formats. Byte, Float32, and Int16. Each of these types has a different The bug I described above is in the API generated configuration for What I'd like you to do is inspect the |
This was the JSON file that I for for I'll check if the nodata value is different for the sample that we use for the simulation run. |
Darn ok - I must have compared an incorrect configuration. @Namyalg maybe you had just applied the patch on #166? @padmajabhol can you please zip and attach the configuration generated by the API so that I can also compare? Or DM me on Slack. |
The latest update to this file https://github.com/Namyalg/FLINT.Cloud/blob/type-error/local/rest_api_gcbm/app.py works, and it does not throw the Values Too large error |
I have assigned the values of nodata in mean_annual_temperature and intial_age as 32767.0, and type as Int16 |
Works for me on cloud shell. |
https://github.com/padmajabhol/LFX-mentorship-progress-tracker/blob/main/Untitled.ipynb |
Hi, Can I work on this ? |
@Namyalg I have Raised a PR |
Currently, the simulation runs without any blockers on Linux environments, we are open to try all possible fix that might help us extend it to all os environments.
cc: @aornugent @HarshCasper
The text was updated successfully, but these errors were encountered: