I have encountered some immediate trouble trying to run ROOT. I am getting the Required Field: ““name” not found” error. However, the name field is present in the csv and I cannot detect any spaces or other potential issues.
I upload an example here of the impact potential raster table csv where ROOT is not recognising the name field.
impact_potential.csv (128 Bytes)
As a side note, I see ROOT is running on Invest version 3.3.3. I presume this is the latest version of ROOT since I recently downloaded it from the Nat Cap website?
Thanks in advance for any help.
Are you sure that the error is referring to the Impact Potential Raster Table and not one of the others (Spatial Weight Maps Table, Composite Factors Table, Objectives Table, or Targets Table)? They all require a column labeled “name”.
The build that’s downloadable from here is the latest version.
Thanks for the response.
The error seemed to be something to with the .csv files having UTF-8 with BOM encoding. After ensuring all the files were just UTF-8, I was able to get to a point where the UI accepted all my inputs and I was able to hit run.
However, the model is throwing up an error straight away and again is saying KeyError: ‘name’. I have attached the log as well as all the .csv files as I cannot determine the cause of the issue.
root-log-2021-05-10–15_10_35.txt (4.5 KB)
composite_factors.csv (55 Bytes)
impact_potential.csv (131 Bytes)
objectives.csv (46 Bytes)
spatial_weights.csv (79 Bytes)
targets.csv (40 Bytes)
Thanks for providing your input tables and log file @lukezw. Yes, the CSV files need to be ASCII, UTF-8, or Signed UTF-8 encoded.
I see that your Objectives Table “objectives.csv” does not include the required column header “name”. Instead, the first column is labeled “objective”. Please try adjusting that and let us know if it solved the issue or not.
Just to clarify about the table encoding, @lukezw if you’re running the version of ROOT that’s built using InVEST 3.3.3, it’ll be safest to save your table as ASCII. The UTF-8 BOM isn’t handled correctly until a much later version of InVEST. This will likely be resolved in a future version of ROOT.
Thanks both for your helpful responses.
I thought I had converted everything to UTF-8 but I see I had missed one or 2 of the csv’s. I will try the ASCII route to be safest when back at work.
Jesse I saw the user guide calls for “name” to be used in the first column of the Objectives Table. However the GUI would not accept this when I was specifying model inputs and instead gave an error saying the column “Objective” wasn’t found. This confused me but the only way I could get the GUI to accept the table was by changing the “name” column to “Objective”.
Update I have managed to get the model to run further after fixing the encoding.
NB: I did have to use ‘objective’ rather than ‘name’ in the header of the first column of the objective table, contrary to what the user guide says.
The model ran for several minutes before throwing up the following error: ValueError encountered: total size of new array must be unchanged (see link to Google Drive link to large log file).
Sorry if it’s something obvious but I can’t figure out the problem. Based on the user guide, I do see that my number of SDUs is quite large at just under 4000 but I’m not sure whether this would be the issue.
@lukezw thanks for letting us know that you had to label the column “objective” instead of “name”. @jdouglass is this a bug or should the UG be updated accordingly?
@lukezw, I’m glad that changing the encoding of the CSVs allowed the model to run further. Unfortunately, I am unfamiliar with the new error you’re receiving, but hopefully someone with more experience using ROOT can assist you further if needed.
Do all of your spatial inputs (rasters and vectors) have the same projection? Do all rasters (the mask and each impact potential raster) have identical extents and cell sizes?
Turns out increasing the SDU size allowed the model to run successfully (still while using “objective” instead of “name” in the objective table). Thanks for all your pointers along the way.
Hello, do you encounter this question? Thank you
HI @Yongxiu ,
This looks like a different issue related to ROOT than what was posted in this thread. Would you mind posting again your issue in a new thread? Thanks.