Select to view content in your preferred language

Re-generate esri_accumulated_stats.json for deep learning training

2259
6
09-06-2020 04:47 PM
TimG
by
Regular Contributor

Hello

Is there a way to re-generate "esri_accumulated_stats.json" after the “Export Training Data For Deep Learning”.  As often I export many areas of interest into separate distinct directories and want to combine all the images and labels into one directory to training on.  In this case it would be great to have something re-generate the json file base on the contents of the consolidated directory.

Would be nice if the maps.txt and stats.txt files were updated too.

Many thanks

0 Kudos
6 Replies
by Anonymous User
Not applicable

Hey,

While exporting the data if you pass the same directory every time for different areas, the directory will contain image chips for all areas of interest and all the related files (maps.txt, stats.txt and esri_accumulated_stats.json) will be automatically updated. You need not pass separate directories everytime for different AOI if the data is same, just use a single one.

TimG
by
Regular Contributor

Thanks Guneet.  Yes you are right, thanks for the help.  I had tried this before but was getting stopped on the below error (a bug?). 

ERROR 002860: Tool parameters are inconsistent with the data you are trying to append to.
Failed to execute (ExportTrainingDataForDeepLearning).

So to resolve this, the "Class Value Field" must contain exactly the same amount of classes as previously run exports in the output directory.  Seems kind of odd to me to have this limitation, but thanks again

TyHayward
Occasional Contributor

@Anonymous User @TI 

I am also getting this error.

I want to add extra training chips to my folder from another set of imagery. The imagery is the same source (sen2) but the ExportTrainingDataForDeepLearning tool is failing when I try to export additional chips.

ERROR 002860: Tool parameters are inconsistent with the data you are trying to append to.
CreateRasterDatasetName: The workspace  does not exist. [south_pigs_22]
Failed to execute (ExportTrainingDataForDeepLearning).
Failed at 08 October 2021 13:47:14 (Elapsed Time: 1.81 seconds)
 
The second error message does not make sense which says the workspace doesn't exist. All of my other parameters are the same and should work fine. My field containing the class has the same number of classes (3) as the other area + set of imagery. I think this is a bug can anyone help? 
 
Please contact me on:
 
All the best,
Ty
0 Kudos
SolanaFoo2
Regular Contributor

I'm getting this error on my first attempt to export chips...

0 Kudos
SolanaFoo2
Regular Contributor

I tested having the tool create a brand new output folder and that made the error go away.  It sounds like you should be able to select an existing folder as an output location (it only shows a warning, not a red x in the tool validation), but I think it's not actually allowing users to select existing folders.

0 Kudos
RavinderVirk_Imagery
Emerging Contributor

Yes, you can select the existing folder, but somehow it generates an error 002860 sometimes (so it may seem a bug). However, if I remove the output folder (e.g EgyBldg) and then re-run the tool by giving the same name to the output folder (e.g. EgyBldg) when running the 'Export training data for deep learning', it runs fine the second time. 

Yes, I made ensure that my new training dataset has exactly the same class value as specified in the pre-trained dlpk. 

0 Kudos