This forum is shutting down! Please post new discussions at

Marine Aquaculture Finfish - KeyError: '1'

emilianaemiliana Member
edited October 2014 in Marine Models
Running aquaculture finfish with less then 100 farm locations it works without errors. When trying to use as input more than 25000 farm locations the following error appears. Do someone encountered the same error? Are there limits on the number of farm locations? Solutions?!?

10/14/2014 10:56:09 root ERROR ---------------------------------------------------
10/14/2014 10:56:09 root ERROR ---------------------- ERROR ----------------------
10/14/2014 10:56:09 root ERROR ---------------------------------------------------
10/14/2014 10:56:09 root ERROR Error: exception found while running finfish_aquaculture

10/14/2014 10:56:09 root DEBUG Exception not environment-related
10/14/2014 10:56:09 root DEBUG Printing traceback
Traceback (most recent call last):
File "invest_natcap\iui\executor.pyc", line 523, in runModel
File "invest_natcap\finfish_aquaculture\finfish_aquaculture.pyc", line 97, in execute
File "invest_natcap\finfish_aquaculture\finfish_aquaculture_core.pyc", line 107, in execute
KeyError: '1'

10/14/2014 10:56:09 root ERROR Exiting due to failures


  • DougDoug Administrator, NatCap Staff

    I don't think it's an issue with the number of farm locations. Looks like one of the farm ID's is getting 'lost' or isn't found in every input. Can you check your data and make sure that Farm ID #1 is found in the tables and in the shapefile polygons?

    - Doug
  • Hello,
    the problem was the 'FarmID' field, it has to be a numeric field!
  • Hello,
    in the Finfish model the user guide states that the model was implemented for the
    aquaculture of Atlantic salmon and the next releases should have the possibility to
    modify the parameters for other marine species. is it possible in the 3.0.1 version? we are using it for seabass and seabream and we changed parameters
    like: initial weight and growth rate, is it enough or there are other parameters that we
    can change to adapt it to our species?
  • Hello,

    It should be possible to adapt the current model to other species. You'll need to make sure that all of the parameters are appropriate for your species and region. This includes the parameters in the Farm Operations table, including daily mortality rate, the target harvest weight, the number of fish outplanted, the fraction of fish remaining after processing, etc. The sample values are really only applicable to Atlantic salmon. Seabream and seabass are sufficiently common in the aquaculture industry that good estimates for these values should be obtainable. Once you have your species-specific parameters, you should do some validation of the model by checking whether the model outputs match local experience. For instance, do fish take about the same amount of time to reach a harvestable size in the model as they do in local farms?

    One potential issue is that the temperature-dependence of growth is fixed in the current Finfish Aquaculture model to 0.08, which may not be appropriate for other species. It is not currently possible for the user to adjust this value. Because of this, I really encourage you to do some validation of your growth model as mentioned above. If you encounter problems with the model due to this value being fixed, let us know and we can explore making it adjustable in a future release.

    Please do let us know if you end up adapting the model for use with other species. We're always interested to know how InVEST models are being applied and adapted, and your experience could be valuable for other users, and maybe even help us build a better tool in the future. I hope you'll consider sharing your results, and maybe even making your parameter sets available for others to use or adapt. Let us know how it goes!

Sign In or Register to comment.