Skip to content
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

Error running basemap_segmentation workflow - sam_inference failed #145

Closed
RMNT opened this issue Feb 7, 2024 · 4 comments
Closed

Error running basemap_segmentation workflow - sam_inference failed #145

RMNT opened this issue Feb 7, 2024 · 4 comments
Assignees
Labels
bug Something isn't working local cluster Issues encountered in local cluster workflows Issues encountered when running workflows

Comments

@RMNT
Copy link

RMNT commented Feb 7, 2024

In which step did you encounter the bug?

Workflow execution

Are you using a local or a remote (AKS) FarmVibes.AI cluster?

Local cluster

Bug description

I am new to using bingmaps so it might be a mistake on my part.

In the website I created a key, copied it and pasted to the BING-MAPS_API_KEY constant. I did not change anything else in the code. After running the code I get this:

                  🌎 FarmVibes.AI 🌍 farm_ai/segmentation/segment_basemap 🌏 
                                 Run name: Basemap segmentation
                         Run id: 4e232c4a-d514-4b34-9987-eb2647fa7b13
                                       Run status: failed
                                     Run duration: 00:00:22

┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Task Name                 ┃ Status ┃ Start and End Time ┃ Duration ┃ Progress   
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ sam_inference                              │failed│...│...│00:00:17│ ━━━━━━━━━━━━━━━━━━━━  0/1    │
│ basemap_download.merge                     │done│...│...│00:00:00│  ━━━━━━━━━━━━━━━━━━━━  1/1     │
│ basemap_download.to_sequence               │done│...│...│00:00:00│  ━━━━━━━━━━━━━━━━━━━━  1/1     │
│ ingest_points.download                     │done│...│...│00:00:01│  ━━━━━━━━━━━━━━━━━━━━  1/1     │
│ basemap_download.basemap_download.download │done│...│...│00:00:00│  ━━━━━━━━━━━━━━━━━━━━  25/25   │
│ ingest_points.unpack                       │done│...│...│00:00:01│  ━━━━━━━━━━━━━━━━━━━━  1/1     │
│ basemap_download.basemap_download.list     │done│...│...│00:00:03│  ━━━━━━━━━━━━━━━━━━━━  1/1     │
└───────────────────────────────────────────────────────────────────────────────────────────────────┘

Key details:

Key type: Basic / Dev/Test
Created date: 02/02/2024
Expiration date: None
Key Status: Enabled
Security Enabled: No

What may I be doing wrong?

Steps to reproduce the problem

No response

@RMNT RMNT added the bug Something isn't working label Feb 7, 2024
@github-actions github-actions bot added triage Issues still not triaged by team local cluster Issues encountered in local cluster workflows Issues encountered when running workflows labels Feb 7, 2024
@rafaspadilha
Copy link
Contributor

rafaspadilha commented Feb 7, 2024

Hi, @RMNT. Thanks for raising the issue. It seems that nothing is wrong with the BingMaps steps of the workflow, but rather to the segmentation op that failed.

Please, could you provide the content of the reason attribute of your run object?

client = get_default_vibe_client()

run = client.run(....)

print(run.reason)

Additionally, did you follow the steps of our documentation for importing the SAM ONNX model to your local cluster?
You can check the instructions in our Troubleshooting page.

@rafaspadilha rafaspadilha removed the triage Issues still not triaged by team label Feb 7, 2024
@rafaspadilha rafaspadilha self-assigned this Feb 7, 2024
@rafaspadilha
Copy link
Contributor

We noticed the script that downloads the SAM models, trace them to ONNX, and export to FarmVibes cluster is missing from the repo (as reported in #153). Your issue might be related to this and the reason might confirm this. If this is the case, you can expect them to be included in the next release. Thank you for your patience.

@rafaspadilha rafaspadilha added the next-release-fix Issues with a fix planned for the next release label Mar 6, 2024
@rafaspadilha rafaspadilha removed the next-release-fix Issues with a fix planned for the next release label Apr 5, 2024
@rafaspadilha
Copy link
Contributor

@RMNT PR #157 adds the missing script and you should be able to run the SAM workflows and notebooks.
Thank you for your patience.

Please, let me know if you are able to test it and if any issues come up.

renatolfc added a commit that referenced this issue Apr 5, 2024
This is a sync of our repo. Here's the summary of the changes:

## Support to new ADMA API version:
**[💔 BREAKING CHANGES]** We added support to the new [Azure Data Manager
for Agriculture
(ADMA)](https://learn.microsoft.com/en-us/rest/api/data-manager-for-agri/?view=rest-data-manager-for-agri-dataplane-2023-11-01-preview)
API version _2023-11-01-preview_. To comply with the new API, some of
our data types, workflows, and notebooks were updated. A summary of the
changes are:

- The `farmer_id` property has now changed to `party_id` in
[`ADMAgSeasonalFieldInput`](https://microsoft.github.io/farmvibes-ai/docfiles/code/vibe_core_data/farm.html#vibe_core.data.farm.ADMAgSeasonalFieldInput)
object (which is passed as input for our workflows) and other [ADMA data
types](https://microsoft.github.io/farmvibes-ai/docfiles/code/vibe_core_data/farm.html).
Also, there is no more the `boundary_id` field as boundary resources are
no more single objects in ADMA. The boundary information is part of the
ADMA entities (seasonal field, field etc.).
- All operations (seasonal field, field, prescriptions etc.) now have
their own geometry.
- Planting information in Seasonal Field was moved to a new operation
["Planting
Data"](https://learn.microsoft.com/en-us/rest/api/data-manager-for-agri/dataplane/planting-data?view=rest-data-manager-for-agri-dataplane-2023-11-01-preview).
- The affected workflows are:
[`data_ingestion/admag/admag_seasonal_field`](https://microsoft.github.io/farmvibes-ai/docfiles/markdown/workflow_yaml/data_ingestion/admag/admag_seasonal_field.html),
[`data_ingestion/admag/prescriptions`](https://microsoft.github.io/farmvibes-ai/docfiles/markdown/workflow_yaml/data_ingestion/admag/prescriptions.html),
and
[`farm_ai/agriculture/heatmap_using_classification_admag`](https://microsoft.github.io/farmvibes-ai/docfiles/markdown/workflow_yaml/farm_ai/agriculture/heatmap_using_classification_admag.html).
- Likewise, the following notebooks have been updated:
[notebooks/admag](https://github.com/microsoft/farmvibes-ai/tree/main/notebooks/admag)
and
[notebooks/heatmaps/nutrients_using_classification_admag](https://github.com/microsoft/farmvibes-ai/blob/main/notebooks/heatmaps/nutrients_using_classification_admag.ipynb).


## Workflows:
- [🎉 NEW] We added new workflows to download and process forest extent
data. These workflows include: (i) the Advanced Land Observing Satellite
(ALOS) forest/non-forest map, (ii) the Global Land Analysis (GLAD)
forest map, and (iii) the Global Forest Change (Hansen) datasets. The
processing workflow detects forest changes using statistical tests
(specifically, the Cochran-Armitage test) to determine whether the
change represents a trend.
- [📈 IMPROVEMENT] We are releasing an updated version of the SpaceEye
workflow that leverages Sentinel-1 RTC products instead of GRD products
with SNAP preprocessing. These changes lead to a significant speedup and
a decrease in disk space consumption. Faster, lighter, and cloudless-er
images to y'all! Due to this new version of the workflow, cached results
are invalid and will be recomputed on new runs.
- [📈 IMPROVEMENT] We extended the
`data_ingestion/weather/download_herbie` workflow to allow downloading
both analysis (zero lead time) up to a point in time and then forecast
with progressively increasing lead times after that.
- [⚒️ FIX] We added a [script](todo-add-link-to-script) to convert
Segment Anything Model (SAM) weights to ONNX format and import it into
the local FarmVibes.AI cluster to be used in the SAM workflows and
notebooks. For instructions on how to use the script, refer to the
_"Adding SAM's ONNX models to the cluster"_ entry in our
[Troubleshooting
page](https://microsoft.github.io/farmvibes-ai/docfiles/markdown/TROUBLESHOOTING.html).
Related to issues #145 and #153.
- [💔 **BREAKING CHANGES**] Planetary Computer API key is required for
all workflows that download or use Sentinel-1 products (e.g.,
`data_ingestion/sentinel1/preprocess_s1` and
`data_ingestion/spaceeye/spaceeye`). The documentation with the
parameter description will be updated in a future release.

## Backend:
- [📈 IMPROVEMENT] We updated our base images to use Python `3.11`, as
well as DAPR `1.13.0`, fixing a few security vulnerabilities of the
previous version that could lead to DoS in the kubernetes services.
Additionally, our DAPR logs are now in JSON format.
- [📈 IMPROVEMENT] We updated `ngrok` package to version `7.1.2`, which
will solve the issues with the [What-if scenario evaluation for carbon
sequestration](https://github.com/microsoft/farmvibes-ai/blob/main/notebooks/carbon/whatif.ipynb)
notebook and `farm_ai/carbon_local/carbon_whatif` workflow. Related to
issue #151.
- [📈 IMPROVEMENT] We improved our worker retry policy and are now using
exponential backoff for retries. This means workers will be less idle on
long queues, avoiding cases where workers would wait for one minute
before starting a queued task.
- [⚒️ FIX] We fixed an issue with the `add-secret` subcommand not adding
secrets to the KeyVault during remote (AKS) cluster setup. Related to
issue #147.

## Notebooks:
- [🎉 NEW] We added a few notebooks showcasing the new forest workflows,
such as downloading [ALOS](todo-add-link-to-notebook) and
[GLAD](todo-add-link-to-notebook) forest maps, and [evaluating forest
changes over time with the Hansen maps](todo-add-link-to-notebook). We
also provide a notebook highlighting how to detect increase/decrease
trends in forest pixel levels over an user-input geometry and time
range.

## Documentation:
- [🎉 NEW] We added a new [REST API documentation
page](https://microsoft.github.io/farmvibes-ai/docfiles/markdown/REST_API.html)
describing the endpoints, parameters, and responses for our API.


## Client:
- [📈 IMPROVEMENT & ⚒️ FIX] We made a few quality-of-life improvements
and bug fixes to our python client. Users can now monitor the last `n`
runs with `client.monitor(n)`, which will print a summarized table with
their progress, as well as retrieve the last `n` `VibeWorkflowRun`
objects with `client.get_last_runs(n)` method. We also added minor bug
fixes to the `monitor` and `document_workflow` methods, which were
breaking for deleated runs and workflows with None/empty value
parameters, respectivelly.

---------
Co-authored-by: Bruno Silva <[email protected]>
Co-authored-by: Eduardo Rodrigues <[email protected]>
Co-authored-by: Leonardo Nunes <[email protected]>
Co-authored-by: Naga Bilwanth Gangarapu <[email protected]>
Co-authored-by: Rafael Padilha <[email protected]>
Co-authored-by: Renato Luiz de Freitas Cunha
<[email protected]>
Co-authored-by: Roberto de Moura Estevão Filho <[email protected]>
@rafaspadilha
Copy link
Contributor

Closing this issue for now. @RMNT, feel free to reopen it if you encounter any more issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working local cluster Issues encountered in local cluster workflows Issues encountered when running workflows
Projects
None yet
Development

No branches or pull requests

2 participants