Skip to content

OverflowError when using match.sh util #10

Open
TimPushkin opened this issue Aug 3, 2021 · 0 comments
Open

OverflowError when using match.sh util #10

TimPushkin opened this issue Aug 3, 2021 · 0 comments
Assignees

Comments

@TimPushkin
Copy link
Collaborator

I get the following error trying to use the match.sh util:

Traceback (most recent call last):
  File "C:\Users\theez\AppData\Roaming\Python\Python38\site-packages\pandas\core\dtypes\cast.py", line 2040, in maybe_cast_to_integer_array
    casted = np.array(arr, dtype=dtype, copy=copy)
OverflowError: Python int too large to convert to C long

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "./get_match.py", line 64, in <module>
    main()
  File "./get_match.py", line 23, in main
    match(vid_1, vid_2)
  File "./get_match.py", line 38, in match
    left = pd.DataFrame({'t': image_timestamps_1,
  File "C:\Users\theez\AppData\Roaming\Python\Python38\site-packages\pandas\core\frame.py", line 614, in __init__
    mgr = dict_to_mgr(data, index, columns, dtype=dtype, copy=copy, typ=manager)
  File "C:\Users\theez\AppData\Roaming\Python\Python38\site-packages\pandas\core\internals\construction.py", line 464, in dict_to_mgr
    return arrays_to_mgr(
  File "C:\Users\theez\AppData\Roaming\Python\Python38\site-packages\pandas\core\internals\construction.py", line 124, in arrays_to_mgr
    arrays = _homogenize(arrays, index, dtype)
  File "C:\Users\theez\AppData\Roaming\Python\Python38\site-packages\pandas\core\internals\construction.py", line 589, in _homogenize
    val = sanitize_array(
  File "C:\Users\theez\AppData\Roaming\Python\Python38\site-packages\pandas\core\construction.py", line 570, in sanitize_array
    subarr = _try_cast(data, dtype, copy, raise_cast_failure)
  File "C:\Users\theez\AppData\Roaming\Python\Python38\site-packages\pandas\core\construction.py", line 755, in _try_cast
    subarr = maybe_cast_to_integer_array(arr, dtype)
  File "C:\Users\theez\AppData\Roaming\Python\Python38\site-packages\pandas\core\dtypes\cast.py", line 2044, in maybe_cast_to_integer_array
    raise OverflowError(
OverflowError: The elements provided in the data cannot all be casted to the dtype int32

Maybe it can be fixed using 'int64' instead of int here - at least that's how I managed to get it running.

My environment:

  • Windows 10 64-bit
  • Python 3.8.5
  • numpy 1.21.1
  • pandas 1.3.1
  • sys.maxsize returns 9223372036854775807 (if it is of any help)

The files (2 videos with their .csvs) that I used can be found here.

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants