Error prepare data

410
22
Jump to solution
12-01-2019 11:13 PM
Highlighted
New Contributor

I'm trying to prepare training data with this detail :

ArcGIS Pro 2.4.2


inRaster = "E:\Work\ArcDL\Base\MANADO_FIX.tif" (raster 8bit unsigned, thematic, with nodata=0)
out_folder = "E:\Work\ArcDL\gtg6"
in_training = "E:\Work\ArcDL\Experiment_BuildFoot_2\MyProject\Shape\House.shp" (shp that has Classvalue, Classname, RED, GREEN, BLUE field)
image_chip_format = "TIFF"
tile_size_x = "256"
tile_size_y = "256"
stride_x="128"
stride_y="128"
output_nofeature_tiles="ONLY_TILES_WITH_FEATURES"
metadata_format="Labeled_Tiles"
start_index = 0
classvalue_field = "Classvalue"
buffer_radius = 1
in_mask_polygons = "E:\Work\ArcDL\Experiment_BuildFoot_2\MyProject\Shape\Mask.shp"
rotation_angle = 0

I run my prepare data syntax just like this :
data = prepare_data('gtg6')

But I always ended up in this kind of error for labeled_tiles metadata format, there's no further explanation and I cant use the data for training since data.show_batch() will result in OSError: -2

Any solution?

Thanks in advance.

Reply
0 Kudos
1 Solution

Accepted Solutions
Highlighted
Esri Contributor

Can you uninstall pillow

pip uninstall pillow

and then install it again using 

pip install pillow

If still you are not able to read the image please attach the image here.

View solution in original post

Reply
0 Kudos
22 Replies
Highlighted
Esri Contributor

Did you set a reasonable cell size in the environment variables?

Also can you post a screenshot of your exported tiles here so that we can have a look at them ?

Reply
0 Kudos
Highlighted
New Contributor

Thank you.., I set my cell size to 0.3, and this is my screenshot at my exported files : 

Because I did this based on tutorial Feature Categorization using Satellite Imagery and Deep Learning | ArcGIS for Developers  then I try to implement that tutorial using the same data based on that tutorial (with cell size 0.1) and this is my screen shot at my exported tiles based on the tutorial :

but it still have the same error and in jupyter notebook it says Cannot read TIFF header : 

anything wrong?
thanks in advance

Reply
0 Kudos
Highlighted
Esri Contributor

You can try exporting your data in any other format like PNG and check if that works.

Reply
0 Kudos
Highlighted
New Contributor

I did have... and no, it not working (I also test JPEG) :

Reply
0 Kudos
Highlighted
Esri Contributor

I can see .tiff as well as .png files in this folder, can you try exporting your data to a new folder ?

Reply
0 Kudos
Highlighted
New Contributor

I use different folder name (you can check at my previous I use "gtg6" for tiff and "gtg12" for png) but however the tiff always follow along... is there something wrong?

Reply
0 Kudos
Highlighted
Esri Contributor

try exporting it in a new empty folder and let me know how it goes.

Reply
0 Kudos
Highlighted
New Contributor

Here's the result :

I always exported to new folder since ArcgisPro won't allow if the output folder already exist.

Here's my environment :

and my ArcGIS Pro version

Reply
0 Kudos
Highlighted
Esri Contributor

Let me try to reproduce this issue.

Reply
0 Kudos