When TCN is used for prediction(python), there is a valueerror: high is out of bounds for int32. I can't find out why
When TCN is used for prediction(python), there is a valueerror: high is out of bounds for int32. I can't find out why
数据库是飞镖,代码是GitHub- https://unit8co.github.io/darts/examples/06-TCN-examples.html
这里的每一个例子都是在pychar上使用的,报错如下
我的环境是conda创建的,虚拟环境是Python3.8
错误信息
Traceback (most recent call last):
File "D:/pycharm/testtcn/energy.py", line 33, in <module>
model_en = TCNModel(
File "D:\anconda\envs\env_name\lib\site-packages\darts\utils\torch.py", line 64, in decorator
manual_seed(self._random_instance.randint(0, high=MAX_TORCH_SEED_VALUE))
File "mtrand.pyx", line 745, in numpy.random.mtrand.RandomState.randint
File "_bounded_integers.pyx", line 1343, in numpy.random._bounded_integers._rand_int32
ValueError: high is out of bounds for int32
转到系统中的文件 ...\site-packages\darts\utils\torch.py
找到应该在第 17 行附近的行 MAX_TORCH_SEED_VALUE = (1 << 63) - 1
将其更改为 MAX_TORCH_SEED_VALUE = (1 << 31) - 1
以便它适合 32 位整数。
保存此更改后,代码应该 运行 没问题。
(来源:https://github.com/unit8co/darts/issues/235#issue-737158114)
数据库是飞镖,代码是GitHub- https://unit8co.github.io/darts/examples/06-TCN-examples.html 这里的每一个例子都是在pychar上使用的,报错如下 我的环境是conda创建的,虚拟环境是Python3.8
错误信息
Traceback (most recent call last):
File "D:/pycharm/testtcn/energy.py", line 33, in <module>
model_en = TCNModel(
File "D:\anconda\envs\env_name\lib\site-packages\darts\utils\torch.py", line 64, in decorator
manual_seed(self._random_instance.randint(0, high=MAX_TORCH_SEED_VALUE))
File "mtrand.pyx", line 745, in numpy.random.mtrand.RandomState.randint
File "_bounded_integers.pyx", line 1343, in numpy.random._bounded_integers._rand_int32
ValueError: high is out of bounds for int32
转到系统中的文件
...\site-packages\darts\utils\torch.py
找到应该在第 17 行附近的行
MAX_TORCH_SEED_VALUE = (1 << 63) - 1
将其更改为
MAX_TORCH_SEED_VALUE = (1 << 31) - 1
以便它适合 32 位整数。
保存此更改后,代码应该 运行 没问题。
(来源:https://github.com/unit8co/darts/issues/235#issue-737158114)