jin-s13 / xtcocoapi

Extended COCO-API
Other
63 stars 24 forks source link

OverflowError: Python int too large to convert to C long #28

Closed LjIA26 closed 2 years ago

LjIA26 commented 2 years ago

Hello!

I got here from the mmpose repository.

I got this error: OverflowError: Python int too large to convert to C long python = 3.8 cuda = 11.3

details below

DONE (t=6.96s) creating index... index created! Running per image evaluation... Evaluate annotation type keypoints Traceback (most recent call last): File "tools/train.py", line 201, in main()
File "tools/train.py", line 190, in main train_model( File "d:\mmpose\mmpose\apis\train.py", line 213, in train_model runner.run(data_loaders, cfg.workflow, cfg.total_epochs) File "C:\Users\LJ\anaconda3\envs\mmpose\lib\site-packages\mmcv\runner\epoch_based_runner.py", line 136, in run epoch_runner(data_loaders[i], *kwargs) File "C:\Users\LJ\anaconda3\envs\mmpose\lib\site-packages\mmcv\runner\epoch_based_runner.py", line 58, in train self.call_hook('after_train_epoch') File "C:\Users\LJ\anaconda3\envs\mmpose\lib\site-packages\mmcv\runner\base_runner.py", line 317, in call_hook getattr(hook, fn_name)(self) File "C:\Users\LJ\anaconda3\envs\mmpose\lib\site-packages\mmcv\runner\hooks\evaluation.py", line 271, in after_train_epoch self._do_evaluate(runner) File "C:\Users\LJ\anaconda3\envs\mmpose\lib\site-packages\mmcv\runner\hooks\evaluation.py", line 277, in _do_evaluate key_score = self.evaluate(runner, results) File "C:\Users\LJ\anaconda3\envs\mmpose\lib\site-packages\mmcv\runner\hooks\evaluation.py", line 367, in evaluate eval_res = self.dataloader.dataset.evaluate( File "C:\Users\LJ\anaconda3\envs\mmpose\lib\site-packages\mmcv\utils\misc.py", line 340, in new_func output = old_func(args, **kwargs) File "d:\mmpose\mmpose\datasets\datasets\top_down\topdown_coco_dataset.py", line 326, in evaluate info_str = self._do_python_keypoint_eval(res_file) File "d:\mmpose\mmpose\datasets\datasets\top_down\topdown_coco_dataset.py", line 389, in _do_python_keypoint_eval coco_eval.evaluate() File "C:\Users\LJ\anaconda3\envs\mmpose\lib\site-packages\xtcocotools\cocoeval.py", line 262, in evaluate self.evalImgs = [evaluateImg(imgId, catId, areaRng, maxDet) File "C:\Users\LJ\anaconda3\envs\mmpose\lib\site-packages\xtcocotools\cocoeval.py", line 262, in self.evalImgs = [evaluateImg(imgId, catId, areaRng, maxDet) File "C:\Users\LJ\anaconda3\envs\mmpose\lib\site-packages\xtcocotools\cocoeval.py", line 456, in evaluateImg dtm[tind, dind] = gt[m]['id'] OverflowError: Python int too large to convert to C long

LjIA26 commented 2 years ago

Turns out that when using pip, the files don't contain the fix.

Downloaded the folder and tried to install it using the steps shown in here, but it also didn't work. I realized that the files didn't get replaced, but when I downloaded the folder, the fix was there. So, I just replaced the files directly in the environment.