Python错误:AttributeError:__enter__ H

2024-04-19 00:13:18 发布

您现在位置:Python中文网/ 问答频道 /正文

I = mpimg.imread(FACE_INPUT_PATH + picname)
I_np = np.array(I)
Traceback (most recent call last):
    File "pretrain_load_test.py", line 67, in <module>
        I = mpimg.imread(FACE_INPUT_PATH + picname)
    File "/home/avicky/env/lib/python3.7/site-packages/matplotlib/image.py", 
        line 1417, in imread
            with Image.open(fname) as image:
    AttributeError: __enter__

Tags: pathinpyimagemostinputnpline