Error running model - "ValueError: No Precip found for month 1"

Error running model

Hello, I’m having problems running the model, the following message appears

“ValueError: No Precip found for month 1”

Hi @Mariane -

When posting about an error, please attach the entire log file (.txt) that the model creates in your Workspace, it gives us more information to work with - thanks!

My first suggestion would be to make sure that your monthly precipitation rasters are named according to the requirements noted in the User Guide. However… when I went to link to the User Guide here, I noticed that the naming requirements are missing in the current version of the Guide. Apologies for that, we’re in the midst of changing how we create the User Guide content, and are still working out the details. We are working on fixing that in the User Guide now, but here are the requirements:

For both precipitation and reference evapotranspiration, each month’s .tif file must end in “_[month number]”, where [month number] is 1 = January, 2 = February, etc.

For example, the precipitation raster for January would be named “precip_1.tif”, precipitation for February named “precip_2.tif” etc, for all 12 months. The beginning of the file name does not matter, only that it ends in _[month number]. So you could also name it “WorldClim_precipitation_1.tif” or whatever and that would work too.

Let us know if that helps.

~ Stacie

3 Likes

Hi Stacie, how are you?

Thank you very much for the feedback, bo the file name adjustments were made as indicated, however, the error persists.Attached is TXT
InVEST-Seasonal-Water-Yield-log-2022-03-02–22_53_15.txt (2.5 KB)
Thanks in advance for the return

Interesting. Can you send a screenshot of what your precipitation folder (C:/Users/Pessoal/Desktop/Teste 1 Invest/chuva) contains?

~ Stacie

Of course I can! here it is

Thanks @Mariane. How strange, it makes no sense at all that you’d be getting that error, just based on seeing the files in that folder. Can you zip up your inputs and put them somewhere I can download? You can either post the link here or send directly to swolny at stanford.edu.

One quick note is that you are using InVEST 3.8, which is ok, but we generally recommend using the latest version, which is 3.10. I doubt that a new version will fix this problem though.

~ Stacie

1 Like

Hi, Here’s a link to the files.
https://drive.google.com/drive/folders/11BN7qD_upQB2hWnIlqxTOkla14fer_Y7?usp=sharing

Hi, Here’s a link to the files.

https://drive.google.com/drive/folders/11BN7qD_upQB2hWnIlqxTOkla14fer_Y7?usp=sharing

Thanks @Mariane. Since I only have two of the model inputs, I can’t try running the model, but I think I know what’s happening with the file naming.

An example of one of the file names is “Precip_1.tif.tif”. I suspect that what the model is doing is looking at the whole file name string before the final file type extension, to determine whether that string matches the model requirements. In this case, the file name string before the final extension is “Precip_1.tif”, and the file type extension is “.tif”. Since the model requires that the initial file name string ends in a number between 1 and 12, this file name does not match, because it ends in .tif, not the number 1.

So my prediction is that if you change these files to “Precip_1.tif”, it will run fine. Try this and let us know if it works.

~ Stacie

3 Likes

Hello Stacie, unfortunately the model didn’t run, even after changing the name of the files, in the folder that I shared with you through google drive are the other files so you can run the complete model. Thanks in advance for your support so far
InVEST-Seasonal-Water-Yield-log-2022-03-08–23_08_33.txt (2.6 KB)

Hi @Mariane -

This time, the error says this:
ValueError: Ambiguous set of files found for month 1: [‘C:/Users/Pessoal/Desktop/TESTE INVEST/Precip\Precip_1.tfw’, ‘C:/Users/Pessoal/Desktop/TESTE INVEST/Precip\Precip_1.tif’]

This is because the precipitation and ET0 folders can only have the .tif file in them for each month of data, no other files. As the User Guide says: “Only .tif files should be in this folder (no .tfw, .xml, etc files).”

What I usually do is make a copy of the precip and ET0 folders that only contain the .tif files, and use that to run the model, and keep a separate copy for use in a GIS, since it is what is creating the .tfw and often other files that are related to a single raster.

~ Stacie

1 Like

Hello Stacie, I still can’t run the model, the error is now in the csv of land use, the same was done according to manual, could you analyze the file?


biophysical_table_gura_SWB.csv (915 Bytes)

Which program did you use to edit the CSV, and which file type did you save it as? In Excel, there are several types of CSV files in the “Save as type” menu. If I save your table as either of these, the model accepts it and does not give an error:

CSV UTF-8 (Comma delimited)
CSV (Comma delimited)

Give that a try and let us know if it helps.

~ Stacie

1 Like

In this particular case, the issue looks like there’s a misalignment in the table columns. Below is a screenshot of the malformed row, where a bonus cell value (green rectangle) is causing the rest of the row’s values to be off by one, creating an extra column value (red circle) where there shouldn’t be one. This can sometimes happen when editing CSV files by hand in a text editor, so it’s always best to check edits in your spreadsheet program of choice to make sure it’s all formatted well.

Here’s what it looks like in a text editor, note the two commas:

Screen Shot 2022-03-10 at 9.58.43 AM

And here’s the fixed table, which does work: biophysical_table_gura_SWB.csv (914 Bytes)

James

2 Likes

Hello, thank you, a lot for the support with solving the problem of the table, however, I still have impediments to running the model, according to the attached error, for what I researched this error refers to the projection of files, but I analyzed the files both are in SIGAS 2000
InVEST-Seasonal-Water-Yield-log-2022-03-15–18_00_37.txt (8.3 KB)

Hi, thank you very much for your support with the spreadsheet.

Hi @Mariane,

It looks like some of your files are still in a different projection. The error message shows the bounding boxes for each raster. Most of them are about [210000, 8079000, 273000, 8223000]. But twelve of them are about [-47.79, -17.42, -47.07, -15.99]. So either your precipitation rasters or your evapotranspiration rasters are in a different projection.

3 Likes

Hello, thank you very much for the support of all the model ran successfully

3 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.