Skip to content

Conversation

@amrzv
Copy link

@amrzv amrzv commented Nov 27, 2025

Hi.
This MR refreshes old tf1 syntax

AttributeError                            Traceback (most recent call last)
[/tmp/ipython-input-770025314.py](https://localhost:8080/#) in <cell line: 0>()
      5 filename = 'panda.jpg'
      6 display.display(display.Image(filename))
----> 7 img = np.array(PIL.Image.open(filename).resize((224, 224))).astype(np.float)

[/usr/local/lib/python3.12/dist-packages/numpy/__init__.py](https://localhost:8080/#) in __getattr__(attr)
    392 
    393         if attr in __former_attrs__:
--> 394             raise AttributeError(__former_attrs__[attr])
    395 
    396         if attr in __expired_attributes__:

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; for more details and guidance see the original release note at:
    https://numpy.org/devdocs/release/1.20.0-notes.html#deprecation

and

AttributeError                            Traceback (most recent call last)
[/tmp/ipython-input-1510045894.py](https://localhost:8080/#) in <cell line: 0>()
      4 checkpoint_name = 'mnasnet-a1'
      5 export_dir = os.path.join(checkpoint_name, 'saved_model')
----> 6 meta_graph_def = tf.saved_model.loader.load([tf.saved_model.tag_constants.SERVING], export_dir)

AttributeError: module 'tensorflow._api.v2.saved_model' has no attribute 'loader'

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

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

Successfully merging this pull request may close these issues.

1 participant