jingw2 / demand_forecast

453 stars 123 forks source link

The following error occurred when Run 'python deep_factors.py -e 100 -spe 3 -rt -not 168 -sp -sl 168 -ms',why ? #21

Open 2017wxyzwxyz opened 3 years ago

2017wxyzwxyz commented 3 years ago

demand_forecast-master>python deep_factors.py -e 100 -spe 3 -rt -not 168 -sp -sl 168 -ms Traceback (most recent call last): File "C:\Anaconda\lib\site-packages\pandas\core\arrays\datetimelike.py", line 932, in _cmp_method other = self._validate_comparison_value(other) File "C:\Anaconda\lib\site-packages\pandas\core\arrays\datetimelike.py", line 451, in _validate_comparison_value raise InvalidComparison(other) pandas.core.arrays.datetimelike.InvalidComparison: 2014-01-01

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "deep_factors.py", line 259, in data = data.loc[(data["date"] >= date(2014, 1, 1)) & (data["date"] <= date(2014, 3, 1))] File "C:\Anaconda\lib\site-packages\pandas\core\ops\common.py", line 65, in new_method return method(self, other) File "C:\Anaconda\lib\site-packages\pandas\core\arraylike.py", line 49, in ge return self._cmp_method(other, operator.ge) File "C:\Anaconda\lib\site-packages\pandas\core\series.py", line 4948, in _cmp_method res_values = ops.comparison_op(lvalues, rvalues, op) File "C:\Anaconda\lib\site-packages\pandas\core\ops\array_ops.py", line 229, in comparison_op res_values = op(lvalues, rvalues) File "C:\Anaconda\lib\site-packages\pandas\core\ops\common.py", line 65, in new_method return method(self, other) File "C:\Anaconda\lib\site-packages\pandas\core\arraylike.py", line 49, in ge return self._cmp_method(other, operator.ge) File "C:\Anaconda\lib\site-packages\pandas\core\arrays\datetimelike.py", line 934, in _cmp_method return invalid_comparison(self, other, op) File "C:\Anaconda\lib\site-packages\pandas\core\ops\invalid.py", line 34, in invalid_comparison raise TypeError(f"Invalid comparison between dtype={left.dtype} and {typ}") TypeError: Invalid comparison between dtype=datetime64[ns] and date

(demand) F:\MsVsPython\ImportPytorchNet\jingw2-DeepAR\11\demand_forecast-master>

QuanhanSun commented 3 years ago

日期格式不对,你看报错信息TypeError: Invalid comparison between dtype=datetime64[ns] and date,你去看pandas的官方文档,注意版本和api怎么使用

2017wxyzwxyz commented 3 years ago

@QuanhanSun,多谢指点!我以前都是用C/C++(有一段时间没用了)、 matlab(稍会些),初学python, debug比较困难,能否把你已经调试好可以运行的基本版本代码发给我一份,同时告诉我相应主要python包的版本,这样我学习时间序列可以有一个比较轻松的平台和开始,先谢谢了!我的邮箱地址是NewWxy2016@163.com

EdoPriyo13 commented 8 months ago

@2017wxyzwxyz Have you got code that can be run with the tpa-lstm model?