报错如下
Traceback (most recent call last):
File "D:anaconda3envstensorflowlibcode.py", line 90, in runcode
exec(code, self.locals)
File "", line 1, in
File "D:Program Files (x86)JetBrainsPyCharm 2021.3.2pluginspythonhelperspydev_pydev_bundlepydev_umd.py", line 198, in runfile
pydev_imports.execfile(filename, global_vars, local_vars) # execute the script
File "D:Program Files (x86)JetBrainsPyCharm 2021.3.2pluginspythonhelperspydev_pydev_imps_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"n", file, 'exec'), glob, loc)
File "D:/Program/project1/test.py", line 12, in
_data = np.load(fullpath, '1.npy')
File "D:anaconda3envstensorflowlibsite-packagesnumpylibnpyio.py", line 417, in load
fid = stack.enter_context(open(os_fspath(file), "rb"))
PermissionError: [Errno 13] Permission denied: './Eegdata\Train'
看了看网上的解释:没有权限,文件夹打开了没关等等,都试过不是。
后来发现是因为错误使用np.load() 对文件夹进行操作了,太傻了我
错误代码如下
fullpath = os.path.join(data_path, split) _data = np.load(fullpath)
os不允许直接对文件夹进行操作
修改如下
fullpath = os.path.join(data_path, split) _data = np.load(os.path.join(fullpath, '1.npy'))


![【Python】IOError: [Errno 13]Permission denied 【Python】IOError: [Errno 13]Permission denied](http://www.mshxw.com/aiimages/31/768969.png)
