IrisRainbowNeko / genshin_auto_fish

基于深度强化学习的原神自动钓鱼AI
4.78k stars 718 forks source link

[ERROR] 'numpy.float64' object cannot be interpreted as an integer #187

Closed kands-code closed 2 years ago

kands-code commented 2 years ago

在训练过程中出现了如下报错:

2021-12-02 08:42:15 | INFO     | yolox.evaluators.coco_evaluator:171 - Evaluate in main process...
2021-12-02 08:42:15 | INFO     | yolox.evaluators.coco_evaluator:204 - Loading and preparing results...
2021-12-02 08:42:15 | INFO     | yolox.evaluators.coco_evaluator:204 - DONE (t=0.01s)
2021-12-02 08:42:15 | INFO     | pycocotools.coco:362 - creating index...
2021-12-02 08:42:15 | INFO     | pycocotools.coco:362 - index created!
2021-12-02 08:42:15 | INFO     | yolox.core.trainer:184 - Training of experiment is done and the best AP is 0.00
2021-12-02 08:42:15 | ERROR    | yolox.core.launch:98 - An error has been caught in function 'launch', process 'MainProcess' (8900), thread 'MainThread' (9032):
Traceback (most recent call last):

  File "yolox_tools\train.py", line 132, in <module>
    args=(exp, args),
          │    └ Namespace(batch_size=4, cache=False, ckpt='weights/yolox_tiny.pth', devices=1, dist_backend='nccl', dist_url=None, exp_file='...
          └ ╒══════════════════╤═════════════════════════════════════════════════════════════════════════════════════════════════════════...

> File "c:\users\lenovo\genshin_auto_fish\yolox\core\launch.py", line 98, in launch
    main_func(*args)
    │          └ (╒══════════════════╤════════════════════════════════════════════════════════════════════════════════════════════════════════...
    └ <function main at 0x000001780A103DC8>

  File "yolox_tools\train.py", line 110, in main
    trainer.train()
    │       └ <function Trainer.train at 0x0000017810F38CA8>
    └ <yolox.core.trainer.Trainer object at 0x00000178124D8848>

  File "c:\users\lenovo\genshin_auto_fish\yolox\core\trainer.py", line 72, in train
    self.train_in_epoch()
    │    └ <function Trainer.train_in_epoch at 0x0000017811AFA9D8>
    └ <yolox.core.trainer.Trainer object at 0x00000178124D8848>

  File "c:\users\lenovo\genshin_auto_fish\yolox\core\trainer.py", line 82, in train_in_epoch
    self.after_epoch()
    │    └ <function Trainer.after_epoch at 0x0000017813870798>
    └ <yolox.core.trainer.Trainer object at 0x00000178124D8848>

  File "c:\users\lenovo\genshin_auto_fish\yolox\core\trainer.py", line 207, in after_epoch
    self.evaluate_and_save_model()
    │    └ <function Trainer.evaluate_and_save_model at 0x0000017813870A68>
    └ <yolox.core.trainer.Trainer object at 0x00000178124D8848>

  File "c:\users\lenovo\genshin_auto_fish\yolox\core\trainer.py", line 303, in evaluate_and_save_model
    evalmodel, self.evaluator, self.is_distributed
    │          │    │          │    └ False
    │          │    │          └ <yolox.core.trainer.Trainer object at 0x00000178124D8848>
    │          │    └ <yolox.evaluators.coco_evaluator.COCOEvaluator object at 0x000001781B337108>
    │          └ <yolox.core.trainer.Trainer object at 0x00000178124D8848>
    └ YOLOX(
        (backbone): YOLOPAFPN(
          (backbone): CSPDarknet(
            (stem): Focus(
              (conv): BaseConv(
                (conv): ...

  File "c:\users\lenovo\genshin_auto_fish\yolox\exp\yolox_base.py", line 288, in eval
    return evaluator.evaluate(model, is_distributed, half)
           │         │        │      │               └ False
           │         │        │      └ False
           │         │        └ YOLOX(
           │         │            (backbone): YOLOPAFPN(
           │         │              (backbone): CSPDarknet(
           │         │                (stem): Focus(
           │         │                  (conv): BaseConv(
           │         │                    (conv): ...
           │         └ <function COCOEvaluator.evaluate at 0x0000017813862B88>
           └ <yolox.evaluators.coco_evaluator.COCOEvaluator object at 0x000001781B337108>

  File "c:\users\lenovo\genshin_auto_fish\yolox\evaluators\coco_evaluator.py", line 131, in evaluate
    eval_results = self.evaluate_prediction(data_list, statistics)
                   │    │                   │          └ tensor([10.2540,  0.1897, 32.0000], device='cuda:0')
                   │    │                   └ [{'image_id': 0, 'category_id': 3, 'bbox': [404.795654296875, 327.560302734375, 276.18157958984375, 106.73675537109375], 'sco...
                   │    └ <function COCOEvaluator.evaluate_prediction at 0x0000017813862CA8>
                   └ <yolox.evaluators.coco_evaluator.COCOEvaluator object at 0x000001781B337108>

  File "c:\users\lenovo\genshin_auto_fish\yolox\evaluators\coco_evaluator.py", line 212, in evaluate_prediction
    cocoEval = COCOeval(cocoGt, cocoDt, annType[1])
               │        │       │       └ ['segm', 'bbox', 'keypoints']
               │        │       └ <pycocotools.coco.COCO object at 0x0000017801300448>
               │        └ <pycocotools.coco.COCO object at 0x00000178137761C8>
               └ <class 'yolox.layers.fast_coco_eval_api.COCOeval_opt'>

  File "D:\anaconda\lib\site-packages\pycocotools\cocoeval.py", line 76, in __init__
    self.params = Params(iouType=iouType) # parameters
    │    │        │              └ 'bbox'
    │    │        └ <class 'pycocotools.cocoeval.Params'>
    │    └ {}
    └ <yolox.layers.fast_coco_eval_api.COCOeval_opt object at 0x00000178017DD6C8>

  File "D:\anaconda\lib\site-packages\pycocotools\cocoeval.py", line 527, in __init__
    self.setDetParams()
    │    └ <function Params.setDetParams at 0x0000017804179DC8>
    └ <pycocotools.cocoeval.Params object at 0x0000017812660FC8>

  File "D:\anaconda\lib\site-packages\pycocotools\cocoeval.py", line 507, in setDetParams
    self.iouThrs = np.linspace(.5, 0.95, np.round((0.95 - .5) / .05) + 1, endpoint=True)
    │              │  │                  │  └ <function round_ at 0x000001780E00C1F8>
    │              │  │                  └ <module 'numpy' from 'D:\\anaconda\\lib\\site-packages\\numpy\\__init__.py'>
    │              │  └ <function linspace at 0x000001780E686828>
    │              └ <module 'numpy' from 'D:\\anaconda\\lib\\site-packages\\numpy\\__init__.py'>
    └ <pycocotools.cocoeval.Params object at 0x0000017812660FC8>

  File "<__array_function__ internals>", line 6, in linspace

  File "D:\anaconda\lib\site-packages\numpy\core\function_base.py", line 120, in linspace
    num = operator.index(num)
          │        │     └ 10.0
          │        └ <built-in function index>
          └ <module 'operator' from 'D:\\anaconda\\lib\\operator.py'>

TypeError: 'numpy.float64' object cannot be interpreted as an integer
IrisRainbowNeko commented 2 years ago

可能是numpy版本的问题,换个版本试试