szymonmaszke / torchlambda

Lightweight tool to deploy PyTorch models to AWS Lambda
MIT License
125 stars 3 forks source link

Demo walkthrough produces error #13

Open life-efficient opened 4 years ago

life-efficient commented 4 years ago

Following the resnet18 demo.

First error encountered:

{"errorMessage":"Required field: \"data\" is not string.","errorType":"InvalidJSON", "stackTrace":[]}

Resolved by adding data = json.dumps(data) after flattening img in create_payload.py.

Second error:

An error occurred (InvalidRequestContentException) when calling the Invoke operation: Could not parse request body into json: Could not parse payload into json: Unrecognized token 'Â': was expecting ('true', 'false' or 'null') at [Source: (byte[])"�'m�^�z(!�^�jֵ�ι�n�ӽu��7��}�����׍u�]�۟=�uۭv�]5�^9�]��u�~�睸�ζ㽹׍5��v�]8�Mz�_<�]y�]v�]5�]��N���x�]��Ou�v�}���u�m�מ�םuߍ���z�]v�^=ן=�^���<�}9�M����_|�]t���㽴�m��nx�n�ӽu�M��^��]y�}�׾}�m�ߍ��]��]y�N�׍��m����]y߭��]���<�]9׏u��t�]�׭���5��w�]�߭v�^u�m�㍶�nw׿5�ͷ�θ���]��m8�]{ێ�߭��^9ן7�m}�N5����Ov���}��͵�_}��z�m:��u�m��m{׎��]xۏv�mu�6�u�Mx�mx׮8����v�^}�_6�M6ӽ�ۍ{�=���۟6���Mu�n��^��}��n|Ӎ;�m5�|�^u�m���|�m��]�Ӎ�߽u��u�޴�6�]��^��}�ou�z�]�׍|ߞ��]8�]{�m"[truncated 991 bytes]; line: 1, column: 3]

Resolved by adding --cli-binary-format raw-in-base64-out flag to cli invoke.

Third error:

{"errorMessage":"RequestId: 704b88e9-f3f3-472e-8f6d-9bd9f6f944aa Error: Runtime exited with error: signal: aborted (core dumped)","errorType":"Runtime.ExitError"}