Skip to content

NumPy-related Error Running with Docker #13

@loujc

Description

@loujc

Dear author,
I'm a Ph.D. student supervised by Yibo Lin. I've encountered some issues when trying to run AutoDMP using Docker and build a docker image.

  • dockerfile error
    The download path for Boost in the Dockerfile has become invalid and needs to be replaced with
https://www.boost.org/users/history/version_1_66_0.html
  • numpy related error - really need help :(
    Firstly, if I use NumPy version 1.20.0, an error will be reported.
Traceback (most recent call last):
  File "./tuner/tuner_train.py", line 28, in <module>
    from hpbandster.optimizers import BOHB as BOHB
  File "/AutoDMP/hpbandster/optimizers/__init__.py", line 1, in <module>
    from hpbandster.optimizers.randomsearch import RandomSearch
  File "/AutoDMP/hpbandster/optimizers/randomsearch.py", line 10, in <module>
    import ConfigSpace as CS
  File "/opt/conda/lib/python3.8/site-packages/ConfigSpace/__init__.py", line 31, in <module>
    from ConfigSpace.api import (
  File "/opt/conda/lib/python3.8/site-packages/ConfigSpace/api/__init__.py", line 1, in <module>
    from ConfigSpace.api import distributions, types
  File "/opt/conda/lib/python3.8/site-packages/ConfigSpace/api/types/__init__.py", line 1, in <module>
    from ConfigSpace.api.types.categorical import Categorical
  File "/opt/conda/lib/python3.8/site-packages/ConfigSpace/api/types/categorical.py", line 6, in <module>
    from ConfigSpace.hyperparameters import CategoricalHyperparameter, OrdinalHyperparameter
  File "/opt/conda/lib/python3.8/site-packages/ConfigSpace/hyperparameters/__init__.py", line 1, in <module>
    from ConfigSpace.hyperparameters.beta_float import BetaFloatHyperparameter
  File "/opt/conda/lib/python3.8/site-packages/ConfigSpace/hyperparameters/beta_float.py", line 10, in <module>
    from ConfigSpace.hyperparameters.distributions import (
  File "/opt/conda/lib/python3.8/site-packages/ConfigSpace/hyperparameters/distributions.py", line 9, in <module>
    from ConfigSpace.functional import (
  File "/opt/conda/lib/python3.8/site-packages/ConfigSpace/functional.py", line 10, in <module>
    from ConfigSpace.types import Number, f64, i64
  File "/opt/conda/lib/python3.8/site-packages/ConfigSpace/types.py", line 9, in <module>
    Mask: TypeAlias = npt.NDArray[np.bool_]
AttributeError: module 'numpy.typing' has no attribute 'NDArray'

Secondly, I searched for solutions online and upgraded NumPy to version 1.21.0, but then another error would be reported.

Traceback (most recent call last):
  File "./tuner/tuner_train.py", line 186, in <module>
    res = bohb.run(n_iterations=args.n_iterations, min_n_workers=args.n_workers)
  File "/AutoDMP/hpbandster/core/master.py", line 206, in run
    next_run = self.iterations[i].get_next_run()
  File "/AutoDMP/hpbandster/core/base_iteration.py", line 170, in get_next_run
    self.add_configuration()
  File "/AutoDMP/hpbandster/core/base_iteration.py", line 103, in add_configuration
    self.result_logger.new_config(config_id, config, config_info)
  File "/AutoDMP/hpbandster/core/result.py", line 150, in new_config
    fh.write(json.dumps([config_id, config, config_info]))
  File "/opt/conda/lib/python3.8/json/__init__.py", line 231, in dumps
    return _default_encoder.encode(obj)
  File "/opt/conda/lib/python3.8/json/encoder.py", line 199, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "/opt/conda/lib/python3.8/json/encoder.py", line 257, in iterencode
    return _iterencode(o, 0)
  File "/opt/conda/lib/python3.8/json/encoder.py", line 179, in default
    raise TypeError(f'Object of type {o.__class__.__name__} '
TypeError: Object of type int64 is not JSON serializable

I'm looking forward your response :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions