AWS lambda tensorflow

0

Hi, my Lambda is a container image. When I test, raise this error:

LAMBDA_WARNING: Unhandled exception. The most likely cause is an issue in the function code. However, in rare cases, a Lambda runtime update can cause unexpected function behavior. For functions using managed runtimes, runtime updates can be triggered by a function change, or can be applied automatically. To determine if the runtime has been updated, check the runtime version in the INIT_START log entry. If this error correlates with a change in the runtime version, you may be able to mitigate this error by temporarily rolling back to the previous runtime version. For more information, see https://docs.aws.amazon.com/lambda/latest/dg/runtimes-update.html [ERROR] Runtime.ImportModuleError: Unable to import module 'dowork': cannot import name 'parse' from 'urllib3' (/var/task/urllib3/__init__.py) Traceback (most recent call last):

This is my "import" section:

import json
from mediapipe import solutions
from mediapipe.framework.formats import landmark_pb2
import numpy as np
import mediapipe as mp
from mediapipe.tasks import python
from mediapipe.tasks.python import vision
#from rembg import remove
from PIL import Image
from io import BytesIO
import cv2
import boto3
from urllib3 import parse
Luca
已提问 1 个月前985 查看次数
1 回答
0
已接受的回答

This is peculiar because urllib3 does not have a top-level module or function named parse; it's more likely that you intended to import something specific from within urllib3. If your intention was to use URL parsing functionalities, those are typically found in the urllib.parse module (part of the standard library in Python 3), not urllib3. Ensure that you're importing what you actually need. If you're looking for functionality that resides within urllib.parse, you should correct the import statement accordingly:

from urllib.parse import urlparse, urlencode, parse_qs, parse_qsl

If this has answered your question or was helpful, accepting the answer would be greatly appreciated. Thank you!

profile picture
专家
已回答 1 个月前
profile picture
专家
已审核 1 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则