#222·pifuhd

DeprecationWarning and AttributeError for np.int in get_rect function

Author: ghasedak3411Created Nov 26, 2024Updated Dec 10, 2024

I encountered a problem while running the get_rect function in the project. Here are the details:

:2: FutureWarning: You are using torch.load with weights_only=False (the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value for weights_only will be flipped to True. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user via torch.serialization.add_safe_globals. We recommend you start setting weights_only=True for any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature. checkpoint = torch.load('checkpoint_iter_370000.pth', map_location='cpu') /content/pifuhd/sample_images/Untitled-1.png

AttributeError Traceback (most recent call last) in <cell line: 5>() 3 load_state(net, checkpoint) 4 print(image_path) ----> 5 get_rect(net.cuda(), [image_path], 512)

1 frames /usr/local/lib/python3.10/dist-packages/numpy/init.py in getattr(attr) 322 323 if attr in former_attrs: --> 324 raise AttributeError(former_attrs[attr]) 325 326 if attr == 'testing':

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 . please help me

Screenshot 2024-11-26 134247