MIND-Lab / OCTIS

OCTIS: Comparing Topic Models is Simple! A python package to optimize and evaluate topic models (accepted at EACL2021 demo track)
MIT License
734 stars 106 forks source link

AttributeError: module 'numpy' has no attribute 'int'. #104

Closed mitramir55 closed 1 year ago

mitramir55 commented 1 year ago

Description

I'm trying to run optimization on models.

What I Did

I started with the default tutorial (link) which is on CTM. When I reach the optimization part:

optimizer=Optimizer()
optimization_result = optimizer.optimize(
    model, dataset, npmi, search_space, number_of_call=optimization_runs, 
    model_runs=model_runs, save_models=True, 
    extra_metrics=None, # to keep track of other metrics
    save_path='results/test_ctm//')

I receive the following error:

AttributeError: module 'numpy' has no attribute 'int'.
`np.int` was a deprecated alias for the builtin `int`. To avoid this error in existing code, use `int` by itself. Doing this will not modify any behavior and is safe. When replacing `np.int`, you may wish to use e.g. `np.int64` or `np.int32` to specify the precision. If you wish to review your current use, check the release note link for additional information.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
    https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations

Then I tried modifying the optimizer by substituting np.int with int in skopt. However, the same problem occurred with transformers library. I believe the version of NumPy has to be downgraded for these libraries to work.

pboutet commented 1 year ago

OCTIS version: 1.12.1 Python version: 3.8.16 Operating System: Ubuntu 20.04.6 LTS

Hitting the same problem.