MIND-Lab / OCTIS

OCTIS: Comparing Topic Models is Simple! A python package to optimize and evaluate topic models (accepted at EACL2021 demo track)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

mitramir55 opened this issue · comments

  • OCTIS version:
  • Python version: 3.10.11
  • Operating System: Linux (Colab notebook)

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.

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

Hitting the same problem.