I exported tiles from a GeoTIFF for import and use with tensorflow outside ArcGIS Pro using the "Label Objects for Machine Learning" tool in ArcGIS Pro.
However, the file structure is different from what tf.keras.preprocessing.image_dataset_from_directory(...) expects and I also think tensorflow will not accept .tif by default. Anyone who has experience using the ArcGIS Pro "Label Objects for Machine Learning" tool in combination with subsequent import in a python session?
The TIF issue is easy to fix - just choose a different format when you export - PNG probably the best.
Import to Tensorflow\Keras generally requires some Python code to convert the images & labels into the internal data structure. It depends on what you are trying to do in Keras as to which export format would be best to use. What type of task are you doing: image classification, object detection, pixel classification? What model are you going to use in Keras: SingleShotDetector, FasterRCNN, MaskRCNN, Unet, etc.?
There will generally be some code out there that you can take and adapt to your data.
Thanks for your answer, I am planning to use a U-Net for image segmentation and classification. I just noticed the different export options (Meta Data Format) in ArcGIS Pro that produce various data structures; I've tried a few but I have not yet gotten a similar structure from what I've seen in example CNN training on the web...
U-Net is not something I have a lot of experience in unfortunately. I have found a couple of pages with both code and data which may help.
This project does image classification on satellite imagery and seems quite straightforward - it has 2 input folders with TIF files that should correspond to the Classified Tiles metadata format output from ArcGIS.
This project has a good blog post with lots of background and github site with the code in a notebook. Same structure of 2 folders with images\masks, but not sure of file format.
Sorry I couldn't be of more help - but hopefully they may assist, or at least point you in the right detection.
Tensorflow supports Tif and GeoTif in both formats. Unet is good for land cover classification and Mark rcnn is good to got detecting building. If it's a single object you can try SSD as well.
Getting the error in Labeling the objects, exporting the chips, and detecting objects are mainly depending on python libraries. Please check the libraries and it's the version which you installed. If the version is not matches to the available one try to downgrade or upgrade to the relevant version and try it.
Here is few tips, if you wish to run outside of ArcGIS Pro:
Once your env is get activated you can start to train the model.