下载数据集:
https://www.cs.ucr.edu/~eamonn/time_series_data/
挂梯子,开全局模式即可
配置环境
虚拟环境基于python=3.9,
tensorflow下载:pip install tensorflow
,不需要tensorflow-gpu(高版本python)
其他零零散散的安装,不用requirements.txt
运行代码
更改数据集路径(根据报错更改)
改成了TSC/datasetsname
keras报错
- 根据类似链接
https://stackoverflow.com/questions/68913520/module-keras-layers-normalization-has-no-attribute-batchnormalizationbase
改一下(把报错信息贴到google即可) - inception.py 111行
发现是因为tensorflow版本不对(从tf1变成了tf2),但这只是一个检测gpu是否可用,那就换个写法。 - tensorflow检测gpu不可用
- 好像是因为,虚拟环境中不能用base的cuda和cudnn?所以又在虚拟环境中安装了
- 发现还是不行,所以又安装了tensorflow-gpu,使用命令
pip install tensorflow-gpu==2.6.0
- 发现pandas和matplotlib版本太新了,试试tf2.8.0
耶,成功了!
-
因为重新安装了,所以又回到了第一个问题
还是解决from keras.layers.normalization.layer_normalization import * from keras.layers.normalization.batch_normalization import *
-
https://stackoverflow.com/questions/69334001/attributeerror-module-keras-optimizers-has-no-attribute-adam
-
Could not locate zlibwapi.dll. Please make sure it is in your library path!
使用https://blog.csdn.net/Chaos_Happy/article/details/124064428 -
Traceback (most recent call last): File "d:\Coding\GitHub\InceptionTime\main.py", line 138, in <module> fit_classifier() File "d:\Coding\GitHub\InceptionTime\main.py", line 49, in fit_classifier classifier.fit(x_train, y_train, x_test, y_test, y_true) File "d:\Coding\GitHub\InceptionTime\classifiers\nne.py", line 74, in fit curr_y_pred = model.predict(x_test, y_true, x_train, y_train, y_test, File "d:\Coding\GitHub\InceptionTime\classifiers\inception.py", line 156, in predict model = keras.models.load_model(model_path) File "C:\Users\DescFly\anaconda3\envs\Inception\lib\site-packages\keras\utils\traceback_utils.py", line 67, in error_handler raise e.with_traceback(filtered_tb) from None File "C:\Users\DescFly\anaconda3\envs\Inception\lib\site-packages\keras\saving\save.py", line 204, in load_model raise IOError(f'No file or directory found at {filepath_str}') OSError: No file or directory found at D:/Coding/GitHub/InceptionTime/results/inception/TSC/Coffee/best_model.hdf5
貌似使用命令& C:/Users/DescFly/anaconda3/envs/Inception/python.exe d:/Coding/GitHub/InceptionTime/main.py InceptionTime直接不训练了;怎么训练起来呢?
难道说这个网络不能被训练吗?