AttributeError: module 'numpy' has no attribute 'int'.
aforadil opened this issue · 0 comments
I am having this issue upon using show_records function. it would be great if someone can guide to workaround this:
"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"
Detailed Error:
(new) C:\Users\Madil2>python code21.py > output.txt
INFO - Loading cached records from extracted-dataset-cache.pkl | icevision.parsers.parser:parse:113
Traceback (most recent call last):
File "code21.py", line 293, in
show_records(train_records[1:4], ncols=3,display_label=True)
File "C:\Users\Madil2.conda\envs\new\lib\site-packages\icevision\visualize\show_data.py", line 151, in show_records
plot_grid(partials, ncols=ncols, figsize=figsize, show=show)
File "C:\Users\Madil2.conda\envs\new\lib\site-packages\icevision\utils\imageio.py", line 105, in plot_grid
f(ax=ax)
File "C:\Users\Madil2.conda\envs\new\lib\site-packages\icevision\imports.py", line 86, in call
return self.partial(*args, **kwargs)
File "C:\Users\Madil2.conda\envs\new\lib\site-packages\icevision\visualize\show_data.py", line 56, in show_record
img = draw_record(
File "C:\Users\Madil2.conda\envs\new\lib\site-packages\icevision\visualize\draw_data.py", line 345, in draw_record
return draw_sample(
File "C:\Users\Madil2.conda\envs\new\lib\site-packages\icevision\visualize\draw_data.py", line 160, in draw_sample
img = draw_bbox(img=img, bbox=bbox, color=color)
File "C:\Users\Madil2.conda\envs\new\lib\site-packages\icevision\visualize\draw_data.py", line 423, in draw_bbox
color = as_rgb_tuple(color)
File "C:\Users\Madil2.conda\envs\new\lib\site-packages\icevision\visualize\utils.py", line 47, in as_rgb_tuple
return tuple(x.astype(np.int))
File "C:\Users\Madil2.conda\envs\new\lib\site-packages\numpy_init.py", line 305, in getattr
raise AttributeError(former_attrs[attr])
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
Thanks