原项目地址:https://aistudio.baidu.com/aistudio/projectdetail/1056213
运行最后一行代码时出现以下报错信息,请问如何解决?
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/matplotlib/__init__.py:107: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
from collections import MutableMapping
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/matplotlib/rcsetup.py:20: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
from collections import Iterable, Mapping
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/matplotlib/colors.py:53: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
from collections import Sized
/home/aistudio/work
---------------------------------------------------------------------------TypeError Traceback (most recent call last) in
8 os.environ["CUDA_VISIBLE_DEVICES"] = "0"
9
---> 10 human_seg = hub.Module('humanseg_server')
11 cap_video = cv2.VideoCapture('demo.mp4')
12 fps = cap_video.get(cv2.CAP_PROP_FPS)
TypeError: __new__() takes 1 positional argument but 2 were given
复现了,应该是版本迭代的问题。
把最后一part代码中的第10行改成:human_seg = hub.Module(name='humanseg_server') 即可