Traceback (most recent call last): File "E:\windows_zuomian\shoushi_Demo\Demo\handpose_control_mask_detection.py", line 114, in <module> bbox = human_RoI_mp.detect(frame) File "E:\windows_zuomian\shoushi_Demo\Demo\utils\RoI.py", line 23, in detect persons = self.detector.infer(image) File "E:\windows_zuomian\shoushi_Demo\Demo\opencv_zoo\models\person_detection_mediapipe\mp_persondet.py", line 59, in infer input_blob, pad_bias = self._preprocess(image) File "E:\windows_zuomian\shoushi_Demo\Demo\opencv_zoo\models\person_detection_mediapipe\mp_persondet.py", line 41, in _preprocess ratio_size = (np.array(image.shape[:2]) * ratio).astype(np.int) File "E:\windows_zuomian\shoushi_Demo\Demo\venv\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 Process finished with exit code 1
时间: 2023-06-08 15:03:29 浏览: 81
这是一个程序运行错误,错误信息显示在第114行,代码中调用了 RoI.py 和 mp_persondet.py 两个模块。报错原因是因为 numpy 模块中的 np.int 已经被弃用,应该使用 Python 内置的 int。在旧代码中使用 int 而不是 np.int 可以避免此错误,这样不会改变任何行为并且是安全的。如果需要替换 np.int,则可以使用 np.int64 或 np.int32 等来指定精度。如果想了解当前用法,请查看发行说明链接以获取更多信息。在 NumPy 1.20 中,此别名最初被弃用;有关详细信息和指导,请参见原发行说明。
相关问题
Traceback (most recent call last): hed_pretrained_bsds.caffemodel是什么
根据提供的信息,hed_pretrained_bsds.caffemodel是一个Caffe模型文件,用于边缘检测任务。在使用HED模型进行边缘检测时,需要使用预训练的模型文件hed_pretrained_bsds.caffemodel。如果在使用该模型文件时出现“Traceback (most recent call last)”的错误提示,可能是由于模型文件路径不正确或模型文件本身存在问题导致的。建议检查模型文件路径是否正确,并尝试重新下载或使用其他版本的hed_pretrained_bsds.caffemodel文件。
Applying contenttypes.0001_initial...Traceback (most recent call last):
This error message suggests that there was an issue when running a Django migration for the `contenttypes` app.
Here are some steps you can try to resolve the issue:
1. Check if there is a more detailed error message above the traceback. This may give you more information about what went wrong during the migration.
2. Make sure that your database is set up correctly and that the user has the necessary permissions. You can try resetting the database or recreating the user with superuser privileges.
3. Check if there are any dependencies or conflicts between the `contenttypes` migration and other migrations in your project. Try running the migrations one at a time to isolate the issue.
4. If all else fails, you can try rolling back to a previous version of your project and then retrying the migration.