Skip to content

numpy == 1.24.3 throws attribute error - deprecated np.float #908

@wario420

Description

@wario420

Description
Quickstart training procedure as described in Docs throws AttributeError.

AttributeError: module 'numpy' has no attribute 'float'.
np.float was a deprecated alias for the builtin float. To avoid this error in existing code, use float by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use np.float64 here.
The aliases was originally deprecated in NumPy 1.20;

Reproduce
Run tranining procedure with nlu_engine.fit() on virtenv with python 3.8 and numbpy == > 1.20.

`import io
import json
from snips_nlu import SnipsNLUEngine

with io.open() as f:
sample_dataset = json.load(f)

nlu_engine = SnipsNLUEngine()

nlu_engine.fit(sample_dataset)

parsing = nlu_engine.parse("Whats the weather today in Tokyo?")
print(json.dumps(parsing, indent=2))`

Expected behavior
Output json as described in the docs quickstart.

If run with numbpy == < 1.20 output is generated as expected.

Environment:

  • OS: MacOS 12.6.3
  • python version: 3.8
  • snips-nlu version: 0.20.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions