Python failed to read files saved directly as TIF or TIF in ENVI.
error is reported as follows:
Traceback (most recent call last):
File "/data/wdh/.conda/envs/AI_studywdh/lib/python3.6/site-packages/tifffile/tifffile.py", line 2296, in __init__
byteorder = {b'II': '<', b'MM': '>', b'EP': '<'}[header[:2]]
KeyError: b'\x00\x00'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "beijing_landsat.py", line 19, in <module>
band1 = imageio.imread(path+img_path[:-1]+'1.tif')
File "/data/wdh/.conda/envs/AI_studywdh/lib/python3.6/site-packages/imageio/core/functions.py", line 265, in imread
reader = read(uri, format, "i", **kwargs)
File "/data/wdh/.conda/envs/AI_studywdh/lib/python3.6/site-packages/imageio/core/functions.py", line 186, in get_reader
return format.get_reader(request)
File "/data/wdh/.conda/envs/AI_studywdh/lib/python3.6/site-packages/imageio/core/format.py", line 170, in get_reader
return self.Reader(self, request)
File "/data/wdh/.conda/envs/AI_studywdh/lib/python3.6/site-packages/imageio/core/format.py", line 221, in __init__
self._open(**self.request.kwargs.copy())
File "/data/wdh/.conda/envs/AI_studywdh/lib/python3.6/site-packages/imageio/plugins/tifffile.py", line 226, in _open
self._tf = _tifffile.TiffFile(f, **kwargs)
File "/data/wdh/.conda/envs/AI_studywdh/lib/python3.6/site-packages/tifffile/tifffile.py", line 2298, in __init__
raise TiffFileError('not a TIFF file')
tifffile.tifffile.TiffFileError: not a TIFF file
Solution:
please use save as option
file — > save as
Read More:
- Solution to the incomplete display of the principle icon number exported by smartpdf in Ad
- Python read / write file error valueerror: I/O operation on closed file
- No code, a solution to the error in the path of reading CSV file by Python: filenotfounderror: [errno 2] no such file or directory: ‘XX. CSV‘
- Error: ‘default’ is not exported by node_ modules/qs/lib/ index.js
- [unable to read project file xxxxx, XXX failed to load project file, name cannot start with “<" character (hex value 0x3c)] exception handling method
- Java 8 Stream – Read a file line by line
- subsystem request failed on channel 0 Couldn’t read packet: Connection reset by peer
- Error reading file cow.osg: read error (Could not find plugin to read objects from file “cow.osg“.)
- Solve the error of POM file failed to read artifact descriptor for XXX under IntelliJ idea
- Java – read all the files and folders in a certain directory and three methods to get the file name from the file path
- Python Anaconda Spyder can’t display pictures by using Matplotlib. Error report solution: figures now render in the plots pane by default. To mak
- Jetson nano uses Python to read and parse GPS data (GPRMC, gpgga).
- Read multiple sheets of an excel file according to npoi
- Cannot read configuration file due to insufficient permissions
- Error reported by wechat applet: cannot read property ‘forceupdate’ of undefined
- C ා use math.net Read. Mat file, file content is complex
- Python reports oserror: initializing from file failed
- CentOS7 nginx Failed to read PID from file /run/nginx.pid: Invalid argument?
- Solution of installing envi error “internal error 25259. DirectX – 9”
- When Python Django creates a database, can’t open file ‘ manage.py ‘: [Errno 2] No such file or directory