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.
Solved! Go to Solution.
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.
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 ?
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
You can try exporting your data in any other format like PNG and check if that works.
I did have... and no, it not working (I also test JPEG) :
I can see .tiff as well as .png files in this folder, can you try exporting your data to a new folder ?
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?
try exporting it in a new empty folder and let me know how it goes.
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
Let me try to reproduce this issue.