Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: 'numpy.int64' object is not iterable #1

Open
HongyuHe opened this issue Nov 3, 2024 · 1 comment
Open

TypeError: 'numpy.int64' object is not iterable #1

HongyuHe opened this issue Nov 3, 2024 · 1 comment

Comments

@HongyuHe
Copy link

HongyuHe commented Nov 3, 2024

Greetings!

I'm encountering the following error:

  • python: 3.10.8
  • OS: macos 15.0.1 (24A348)
  • cmd: python cp2022_experiments.py -exp graph
  • Error trace:
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/multiprocessing/pool.py", line 125, in worker
    result = (True, func(*args, **kwds))
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/multiprocessing/pool.py", line 51, in starmapstar
    return list(itertools.starmap(args[0], args[1]))
  File "/Users/user/COUNT-CP/cp2022_experiments.py", line 36, in experiment_time_taken
    bounding_expressions = learn(instances[:1], training_size, symbolic)
  File "/Users/user/COUNT-CP/learn.py", line 458, in learn
    for key, val in learn_for_expression(instances, exp, symbolic, training_size).items():
  File "/Users/user/COUNT-CP/learn.py", line 387, in learn_for_expression
    local_bounds = learn_local_bounds(instance, expression, training_size)
  File "/Users/user/COUNT-CP/learn.py", line 357, in learn_local_bounds
    compute_bounds(indices)
  File "/Users/user/COUNT-CP/learn.py", line 347, in compute_bounds
    lb, ub = expression.bounds(*args)
  File "/Users/user/COUNT-CP/learn.py", line 51, in bounds
    return min(vals), max(vals)
  File "/Users/user/COUNT-CP/venv/lib/python3.10/site-packages/cpmpy/expressions/python_builtins.py", line 110, in min
    return builtins.min(*iterable, **kwargs)
TypeError: 'numpy.int64' object is not iterable

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

Traceback (most recent call last):
  File "/Users/user/COUNT-CP/cp2022_experiments.py", line 174, in <module>
    pool.starmap(experiment_time_taken, iterations)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/multiprocessing/pool.py", line 375, in starmap
    return self._map_async(func, iterable, starmapstar, chunksize).get()
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/multiprocessing/pool.py", line 774, in get
    raise self._value
TypeError: 'numpy.int64' object is not iterable
@HongyuHe
Copy link
Author

Also, the statistic() function in cp2022_experiments.py is also missing. Would appreciate any help!

@tias @probberechts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant