ENVI匯出的tif檔案,python讀取失敗。
ENVI中直接儲存為tif或TIF的檔案,python讀取失敗。
報錯如下:
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
解決方法:
請使用另存為選項
file—>save as
相關文章
- 使用Python讀取PlantUML匯出的XMI檔案Python
- docker啟動的服務有匯出檔案的功能,檔案一直匯出失敗Docker
- php讀取excel檔案資料的匯入和匯出PHPExcel
- kodbox讀取alist檔案失敗,問題解決過程
- Clion中C++使用當前目錄讀取檔案失敗C++
- python擴充套件檔案import失敗Python套件Import
- Spring Boot讀取外部配置檔案失敗,原因絕對出乎你意料Spring Boot
- python讀取大檔案Python
- python小白檔案讀取Python
- python 讀取文字檔案Python
- mysql匯入sql檔案過大失敗怎麼辦MySql
- win10 讀取檔案錯誤怎麼辦 win10讀取文件失敗什麼原因Win10
- python如何讀取大檔案Python
- python讀取yaml配置檔案的方法PythonYAML
- 引入js檔案失敗JS
- 網站搬家時匯入SQL Server備份檔案失敗網站SQLServer
- Python 讀取HDF5檔案Python
- python怎麼讀取配置檔案Python
- python解壓並讀取檔案Python
- Python的configparser模組讀取.ini檔案內容並輸出Python
- python讀取大檔案的幾種方法Python
- rz檔案傳輸失敗
- CF卡讀取失敗修復方法?
- Python生成器讀取大檔案Python
- python檔案建立、讀取和寫入Python
- 透過python讀取ini配置檔案Python
- python 使用字典讀取CSV檔案Python
- python檔案讀取 readlines()方法之坑Python
- python-geopandas讀取、建立shapefile檔案Python
- 如何在python中讀取配置檔案Python
- python讀取檔案指定行的三種方法Python
- Python逐行讀取檔案常用的三種方法!Python
- python讀取兩個excel資料檔案輸出整理好以後的excel資料檔案PythonExcel
- rman備份的時候讀取v$session_longops失敗導致備份失敗SessionGo
- Python-檔案的匯入Python
- EasyExcel完成excel檔案的匯入匯出Excel
- python讀取docx檔案,就是如此簡單Python
- Python實用方法之讀取本地檔案Python