putyourheart 2019-10-09 16:07 采纳率: 50%
浏览 5050
已采纳

在Cent OS中复现已发表文章的 神经网络训练过程,报错ValueError: low >= high

Traceback (most recent call last):
  File "trainIEEE39LoadSheddingAgent.py", line 139, in <module>
    env.reset()
  File "/root/RLGC/src/py/PowerDynSimEnvDef_v3.py", line 251, in reset
    fault_bus_idx = np.random.randint(0, total_fault_buses)# an integer, in the range of [0, total_bus_num-1]
  File "mtrand.pyx", line 630, in numpy.random.mtrand.RandomState.randint
  File "bounded_integers.pyx", line 1228, in numpy.random.bounded_integers._rand_int64
ValueError: low >= high


报错如上,为什么会这样报错?如何解决?谢谢!

  • 写回答

1条回答

  • 根号下心 2020-05-22 18:52
    关注

    np.random.randint(low,high)中,出现这种错误即你的total_fault_buses取值为0,你的low=high=0就会报错了!

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

问题事件

  • 已采纳回答 4月5日

悬赏问题

  • ¥20 双层网络上信息-疾病传播
  • ¥50 paddlepaddle pinn
  • ¥20 idea运行测试代码报错问题
  • ¥15 网络监控:网络故障告警通知
  • ¥15 django项目运行报编码错误
  • ¥15 请问这个是什么意思?
  • ¥15 STM32驱动继电器
  • ¥15 Windows server update services
  • ¥15 关于#c语言#的问题:我现在在做一个墨水屏设计,2.9英寸的小屏怎么换4.2英寸大屏
  • ¥15 模糊pid与pid仿真结果几乎一样