数据库是darts,代码是GitHub-https://unit8co.github.io/darts/examples/06-TCN-examples.html 这里的每个示例都在pychar上使用,但有以下错误 我的环境是由CONDA创建的,虚拟环境是Python 3.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位int保存此更改后,代码应该可以正常运行
(信用证:https://github.com/unit8co/darts/issues/235#issue-737158114)
相关问题 更多 >
编程相关推荐