Select to view content in your preferred language

Deep Learning prepare_data

3154
10
11-25-2019 10:54 AM
LaurynasGedminas2
Regular Contributor

Hello,

I am following the example here for pixel classification:

Pixel-based Classification Workflow with | ArcGIS for Developers 

In my case I am exporting data and labels from ArcPro, when i run:

data = prepare_data(data_path, batch_size=16)

I get error:

TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'''

What is the parameter settings needed in ArcPro to export data for this example?

API version: 1.7.0

ArcGIS Pro 2.4

Thank you,

Tags (1)
0 Kudos
10 Replies
LaurynasGedminas2
Regular Contributor

If i export data as 'labelled tiles' i get error:

lib\site-packages\arcgis\learn\_data.py in prepare_data(path, class_mapping, chip_size, val_split_pct, batch_size, transforms, collate_fn, seed, dataset_type, resize_to, **kwargs)    357     358     if dataset_type is None and not has_esri_files:--> 359         raise Exception("Could not infer dataset type.")    360     361     if dataset_type != "Imagenet" and has_esri_files:Exception: Could not infer dataset type.
0 Kudos
by Anonymous User
Not applicable

Try specifying the dataset_type. So for Classification tiles, add dataset_type='Classified_Tiles' to call the prepare_data function.

0 Kudos
LaurynasGedminas2
Regular Contributor

when i try to export  'Classified Tiles' thru export tool it gives error: ERROR 002091  Parameters are inconsistent.

0 Kudos
by Anonymous User
Not applicable

Can you post a screenshot of parameters you have supplied to the tool.

0 Kudos
LaurynasGedminas2
Regular Contributor

this gives the ERROR 002091  Parameters are inconsistent. 

it's 3 band raster, TIFF or PNG still the same, sites were produced by the Training Sample Manager:

0 Kudos
by Anonymous User
Not applicable

Can you check if there is any missing values in the ClassValue column .

0 Kudos
stephenescarzaga
Occasional Contributor

I just went through this problem. Documentation says that exporting "classified_tiles" requires a classified raster (thematic) instead of feature class. So I had to do polygon to raster, then 'set raster properties'. Once I did that It let me export. Not sure if this is the correct way. 

EDIT: looking at the 'extract building foot prints' here, my workflow with ultimately not work. I'm trying to prepare the data now for training and I'm getting errors. 

by Anonymous User
Not applicable
0 Kudos
by Anonymous User
Not applicable

Laurynas Gedminas Try to follow the methodology documented in this link to export training data for classified tiles here Extracting Building Footprints From Drone Data | ArcGIS for Developers .

0 Kudos