OSError: cannot identify image file

6587
11
02-18-2020 10:52 AM
JingyiHu
New Contributor

I have this issue when I try to use prepare_data function. I already have the newest version of pillow. 
I also noticed that the tiff files that I get from the "export training data for deep learning" can not be opened . 
(constantly showing this)
 
As fopr the meta data format, I tried labeled tiles, classified tiles, KITTI labels and PASCAL VOC format. None of their output tiff can be opened.

I m wondering how can I fix this? Thank you!
0 Kudos
11 Replies
by Anonymous User
Not applicable

Can you post a sample tile here and the metadata of the tile, it seems that the imagery you are using is multi spectral imagery. You need to convert multi spectral imagery to RGB format with datatype 8-bit unsigned, you can do it so by layer -> right click -> Export Raster and then check render and RGB options while exporting data. 

Also we have added experimental support for multi spectral data, you can trigger that by adding imagery_type='ms'  kwarg to prepare_data() method. You can directly used you training data this way, you need to have gdal installed in order to use it. if you are using arcgis pro python environment it would be there by default.

AdrianHughes3
Occasional Contributor

I'm using ms imagery and had this error. Using imagery_type ='ms' fixed this.

However, data.show_batch() does not return any images in the notebook. Is this an issue for ms imagery?

Thanks

0 Kudos
AdrianHughes3
Occasional Contributor

The error in the OP also occurs with the Train Deep learning Model tool in Pro 2.5

When working with multispectral imagery do I need to use Notebook and arcgis.learn as opposed to the tools in pro which will not work with ms imagery?

0 Kudos
by Anonymous User
Not applicable
Hello I have *the same prbm
Please help me
\Users\CE-PC\AppData\Local\ESRI\conda\envs\deeplearning\Lib\site-packages\PIL\Image.py", line 2822, in open     raise IOError("cannot identify image file %r" % (filename if filename else fp)) OSError: cannot identify image file 'C:\\Export1\\images\\000000000.tif'
Échec de l’exécution de (TrainDeepLearningModel).
0 Kudos
KeiranBray
Esri Contributor

Hey @Adrian Hughes did you find a resolution for this?

0 Kudos
AdrianHughes3
Occasional Contributor

I've not looked at this for a while but yes the fix was to use  imagery_type ='ms'. Interestingly my training data did not display in the ArcGIS Pro notebook but did display in the jupyter notebook (launched from startmenu under arcgis )

I will be looking at this again soon and will follow the guidelines on ms imagery in the documentation link posted

0 Kudos
by Anonymous User
Not applicable
Hello I have *the same prbm
Please help me
\Users\CE-PC\AppData\Local\ESRI\conda\envs\deeplearning\Lib\site-packages\PIL\Image.py", line 2822, in open     raise IOError("cannot identify image file %r" % (filename if filename else fp)) OSError: cannot identify image file 'C:\\Export1\\images\\000000000.tif'
Échec de l’exécution de (TrainDeepLearningModel).
0 Kudos
by Anonymous User
Not applicable
Hello I have *the same prbm
Please help me
\Users\CE-PC\AppData\Local\ESRI\conda\envs\deeplearning\Lib\site-packages\PIL\Image.py", line 2822, in open     raise IOError("cannot identify image file %r" % (filename if filename else fp)) OSError: cannot identify image file 'C:\\Export1\\images\\000000000.tif'
Échec de l’exécution de (TrainDeepLearningModel).
0 Kudos
by Anonymous User
Not applicable

You can use the following guide to train models on multispectral imagery.

Working with Multispectral Data | ArcGIS for Developers 

0 Kudos