D:\python\python.exe D:\tokamaka\实验集\Python\SVM低数据兼测试版本\Test.py Traceback (most recent call last): File "D:\tokamaka\实验集\Python\SVM低数据兼测试版本\Test.py", line 10, in <module> f = h5py.File(os.path.join(direction, '{1051501}.hdf5'), 'r') File "D:\python\lib\site-packages\h5py\_hl\files.py", line 567, in __init__ fid = make_fid(name, mode, userblock_size, fapl, fcpl, swmr=swmr) File "D:\python\lib\site-packages\h5py\_hl\files.py", line 231, in make_fid fid = h5f.open(name, flags, fapl=fapl) File "h5py\_objects.pyx", line 54, in h5py._objects.with_phil.wrapper File "h5py\_objects.pyx", line 55, in h5py._objects.with_phil.wrapper File "h5py\h5f.pyx", line 106, in h5py.h5f.open FileNotFoundError: [Errno 2] Unable to open file (unable to open file: name = 'D:\tokamaka\实验集\Python\SVM低数据兼测试版本\DataPreProcess\DataSet_normalize\train\{1051501}.hdf5', errno = 2, error message = 'No such file or directory', flags = 0, o_flags = 0)
时间: 2023-07-21 22:36:51 浏览: 104
根据您提供的信息,程序在读取文件时出现了错误,提示无法打开文件。错误信息显示,程序需要读取的文件为 "D:\tokamaka\实验集\Python\SVM低数据兼测试版本\DataPreProcess\DataSet_normalize\train\{1051501}.hdf5",但是该文件不存在。您需要检查该文件是否存在,或者文件路径是否正确。
相关问题
D:\python\python.exe D:\tokamaka\实验集\Python\SVM低数据兼测试版本\DisruptionPredictor\Test3.py Traceback (most recent call last): File "D:\tokamaka\实验集\Python\SVM低数据兼测试版本\DisruptionPredictor\Test3.py", line 62, in <module> for j in range(train_data[i].shape[1]): AttributeError: 'list' object has no attribute 'shape'
根据你给出的信息,这个错误的原因是在第 62 行,`train_data[i]` 是一个列表,而不是一个 numpy 数组,因此没有 `shape` 属性。你需要检查一下 `train_data` 列表中的元素是否都是 numpy 数组,如果有不是的,需要将其转换为 numpy 数组。你可以使用 `np.array()` 函数将列表转换为 numpy 数组。
Traceback (most recent call last): File "D:\tokamaka\实验集\Python\SVM低数据兼测试版本\Test.py", line 3, in <module> read = Reader('D:\tokamaka\实验集\Python\SVM低数据兼测试版本\DataPreProcess\DataSet_normalize\train') File "D:\tokamaka\实验集\Python\SVM低数据兼测试版本\DataPreProcess\Data.py", line 49, in __init__ raise ValueError('Path {} does n\'t exist.') ValueError: Path {} does n't exist.
这个错误提示意味着你在创建 `Reader` 对象时提供的路径 `D:\tokamaka\实验集\Python\SVM低数据兼测试版本\DataPreProcess\DataSet_normalize\train` 不存在。你需要检查一下该路径是否正确,以及该路径下是否存在需要读取的文件。如果路径不正确,你需要提供正确的路径;如果路径正确但是文件不存在,你需要创建该文件或者提供正确的文件路径。另外,你在抛出 `ValueError` 异常时使用了一个格式化字符串,但是没有提供格式化参数。你需要在字符串中使用 `{}` 占位符,并在抛出异常时提供一个格式化参数,例如:
```python
raise ValueError('Path {} does not exist.'.format(path))
```
其中 `path` 是你提供的路径。
相关推荐
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)