python - OSError 无法创建文件(无法打开 .mat 文件,errno = 17,错误消息 = '文件存在',标志 = 15,o_flags = 502)
问题描述
我想阅读这个 .mat 文件(https://www.kaggle.com/crawford/deepsat-sat6)并希望将其可视化/转换为 jpg 中的图像。请参考下面的代码和错误。请帮助我克服错误。
import matplotlib.pyplot as plt
import numpy as np
import h5py
from PIL import Image
filepath = 'D:\deepsat-sat6\sat-6-full.mat'
H5PY_DEFAULT_READONLY=1
f = h5py.File(filepath, 'r') #to open .mat file for reading
OSError: Unable to create file (unable to open file: name = 'D:\deepsat-sat6\sat-6-full.mat',
errno = 17, error message = 'File exists', flags = 15, o_flags = 502)
解决方案
推荐阅读
- java - For循环覆盖数组一旦完成
- javascript - 如何在 chrome 扩展中添加“读取和更改您访问的网站上的所有数据”权限?
- mysql - 如何获取 MySQL 中的最新值?
- ios - 在隐式展开 Optional 时意外发现 nil
- logging - docker-compose down 超时
- c++ - VSCode + cmake + windows 10 - > cmake不在路径中
- php - Wordpress - 找不到 wp-admin
- neo4j - 如何限制 Neo4j 中两个节点之间只有一种关系?
- python - Plotly:如何以十六进制显示轴刻度?
- elasticsearch - elasticsearch摄取管道重命名动态字段