Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backend Issue #4

Open
RyanManchikanti opened this issue Mar 28, 2021 · 7 comments
Open

Backend Issue #4

RyanManchikanti opened this issue Mar 28, 2021 · 7 comments

Comments

@RyanManchikanti
Copy link

After following everything described in the tutorial , i finally got a url after deploying sls model.
when i pasted that url in notebooks an executed the code i kept getting this error, any help is much appreciated , i'm very close to completing this project i need help with this error.

KeyError: 'output'
KeyError Traceback (most recent call last)
in
----> 1 image = response.json()["output"]
2
3 image = image[image.find(",")+1:]
4 dec = base64.b64decode(image + "===")
5
KeyError: 'output'

@ahmedbesbes
Copy link
Owner

this means that the code didn't execute correctly. You have to check the logs in the cloudwatch

@ahmedbesbes ahmedbesbes mentioned this issue Apr 9, 2021
@RyanManchikanti
Copy link
Author

how do i do that ?

@ahmedbesbes
Copy link
Owner

connect to your AWS account and check the cloudwatch logs related to your lambda function. It will tell you what error occurred. I cannot really help you without that specific information.

@RyanManchikanti
Copy link
Author

I opened my aws cloudwatch what should i be looking for ?

@sherlockholmes211
Copy link

connect to your AWS account and check the cloudwatch logs related to your lambda function. It will tell you what error occurred. I cannot really help you without that specific information.

I have also got the same error and I have checked the logs it was showing below error what to do?
[ERROR] ClientError: An error occurred (AccessDenied) when calling the GetObject operation: Access Denied
Traceback (most recent call last):
  File "/var/lang/lib/python3.7/imp.py", line 234, in load_module
    return load_source(name, filename, file)
  File "/var/lang/lib/python3.7/imp.py", line 171, in load_source
    module = _load(spec)
  File "", line 696, in _load
  File "", line 677, in _load_unlocked
  File "", line 728, in exec_module
  File "", line 219, in _call_with_frames_removed
  File "/var/task/src/handler.py", line 55, in
    models = load_models(s3, bucket)
  File "/var/task/src/handler.py", line 39, in load_models
    response = s3.get_object(Bucket=bucket, Key=f"models/{style}_net_G_float.pth")
  File "/var/runtime/botocore/client.py", line 357, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "/var/runtime/botocore/client.py", line 676, in _make_api_call
    raise error_class(parsed_response, operation_name)

@ahmedbesbes
Copy link
Owner

connect to your AWS account and check the cloudwatch logs related to your lambda function. It will tell you what error occurred. I cannot really help you without that specific information.

I have also got the same error and I have checked the logs it was showing below error what to do?
[ERROR] ClientError: An error occurred (AccessDenied) when calling the GetObject operation: Access Denied
Traceback (most recent call last):
  File "/var/lang/lib/python3.7/imp.py", line 234, in load_module
    return load_source(name, filename, file)
  File "/var/lang/lib/python3.7/imp.py", line 171, in load_source
    module = _load(spec)
  File "", line 696, in _load
  File "", line 677, in _load_unlocked
  File "", line 728, in exec_module
  File "", line 219, in _call_with_frames_removed
  File "/var/task/src/handler.py", line 55, in
    models = load_models(s3, bucket)
  File "/var/task/src/handler.py", line 39, in load_models
    response = s3.get_object(Bucket=bucket, Key=f"models/{style}_net_G_float.pth")
  File "/var/runtime/botocore/client.py", line 357, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "/var/runtime/botocore/client.py", line 676, in _make_api_call
    raise error_class(parsed_response, operation_name)

You'll have to specify your own buckets. You're referencing mine in the code. That's why you have an AccessDenied error I think.

@sherlockholmes211
Copy link

connect to your AWS account and check the cloudwatch logs related to your lambda function. It will tell you what error occurred. I cannot really help you without that specific information.

I have also got the same error and I have checked the logs it was showing below error what to do?
[ERROR] ClientError: An error occurred (AccessDenied) when calling the GetObject operation: Access Denied
Traceback (most recent call last):
  File "/var/lang/lib/python3.7/imp.py", line 234, in load_module
    return load_source(name, filename, file)
  File "/var/lang/lib/python3.7/imp.py", line 171, in load_source
    module = _load(spec)
  File "", line 696, in _load
  File "", line 677, in _load_unlocked
  File "", line 728, in exec_module
  File "", line 219, in _call_with_frames_removed
  File "/var/task/src/handler.py", line 55, in
    models = load_models(s3, bucket)
  File "/var/task/src/handler.py", line 39, in load_models
    response = s3.get_object(Bucket=bucket, Key=f"models/{style}_net_G_float.pth")
  File "/var/runtime/botocore/client.py", line 357, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "/var/runtime/botocore/client.py", line 676, in _make_api_call
    raise error_class(parsed_response, operation_name)

You'll have to specify your own buckets. You're referencing mine in the code. That's why you have an AccessDenied error I think.

Solved the issue as you have said I have referenced the wrong bucket, By the way, thanks for this awesome tutorial, I hope in the future we get more amazing playlist

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants