DataCanvasIO / HyperTS

A Full-Pipeline Automated Time Series (AutoTS) Analysis Toolkit.
https://hyperts.readthedocs.io
Apache License 2.0
260 stars 27 forks source link

指定mode为dl会报错 #114

Closed Bang0518 closed 4 months ago

Bang0518 commented 5 months ago

采用官方快速开始示例,将代码块

experiment = make_experiment(train_data=train_data.copy(),
                            task='forecast',
                            timestamp='TimeStamp',
                            covariables=['HourSin', 'WeekCos', 'CBWD'])
model = experiment.run()

修改为

experiment = make_experiment(train_data=train_data.copy(),
                            task='forecast',
                            timestamp='TimeStamp',
                            mode = 'dl',
                            covariables=['HourSin', 'WeekCos', 'CBWD'])
model = experiment.run()

将会导致报错如下:

03-22 02:18:25 E hypernets.e._experiment.py 107 - ExperimentID:[HyperTS_a7bae5a247591977073d99a7cb31a213] - None: Not found available trial, change experiment settings and try again pls.
Traceback (most recent call last):
  File "/home/codespace/.local/lib/python3.10/site-packages/hypernets/experiment/_experiment.py", line 91, in run
    model = self.train(self.hyper_model, self.X_train, self.y_train, self.X_test, X_eval=self.X_eval,
  File "/home/codespace/.local/lib/python3.10/site-packages/hypernets/experiment/compete.py", line 1582, in train
    raise e
  File "/home/codespace/.local/lib/python3.10/site-packages/hypernets/experiment/compete.py", line 1573, in train
    step.fit_transform(hyper_model, X_train, y_train, X_test=X_test, X_eval=X_eval, y_eval=y_eval,
  File "/home/codespace/.local/lib/python3.10/site-packages/hypernets/experiment/compete.py", line 1004, in fit_transform
    raise RuntimeError('Not found available trial, change experiment settings and try again pls.')
RuntimeError: Not found available trial, change experiment settings and try again pls.
Bang0518 commented 5 months ago

全过程在GitHub的codespace中进行,已确保安装了必要的库

zhangxjohn commented 5 months ago

Thanks for your asking! 是某一次trial出现了,还是一直出现RuntimeError: Not found available trial, change experiment settings and try again pls.最后失败了?

Bang0518 commented 5 months ago

所有trial都出现报错。 在最新版本下,该问题可通过描述进行复现,仅需添加一行

mode = 'dl',
zhangxjohn commented 5 months ago

安装tensorflow了吗? 我运行所有的CI Test 没有问题。

Bang0518 commented 5 months ago

安装tensorflow了吗? 我运行所有的CI Test 没有问题。

有的,运行前使用了pip install -r requirement.txt进行的包的安装,使用pip list命令结果如下 image

Bang0518 commented 5 months ago

完整代码如下

from hyperts import make_experiment
from hyperts.datasets import load_network_traffic

from sklearn.model_selection import train_test_split

data = load_network_traffic()
train_data, test_data = train_test_split(data, test_size=0.2, shuffle=False)

model = make_experiment(train_data.copy(),
                        task='multivariate-forecast',
                        mode='dl',
                        timestamp='TimeStamp',
                        covariates=['HourSin', 'WeekCos', 'CBWD']).run()

X_test, y_test = model.split_X_y(test_data.copy())

y_pred = model.predict(X_test)

scores = model.evaluate(y_test, y_pred)

model.plot(forecast=y_pred, actual=test_data)

本地和codespace均可复现该问题 image

Bang0518 commented 5 months ago

如果不指定dl模型,而改用默认的统计学模型,则不会有任何问题 image

zhangxjohn commented 5 months ago

你试试将tensorflow降到<=2.10.0。我猜测tensorflow的版本(2.16.1)太高了,有些代码被重构了。

Bang0518 commented 5 months ago

Collaborator

解决了,我认为有必要把requirement.txt的内容进行修改

zhangxjohn commented 5 months ago

感谢你的建议,后期会进行修正。