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
질문됨 한 달 전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
전문가
답변함 한 달 전
profile picture
전문가
검토됨 한 달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠