Getting '502 Bad Gateway' error when accessing TensorFlow Django app deployed on the Google App Engine Flexible Environment

54 views Asked by At

I am trying to deploy my Django app, which includes TensorFlow, on the Google App Engine Flexible Environment. The deployment was successful, but I encountered warnings and errors related to TensorFlow:

2023-06-25 11:24:30 default[20230625t180702]  2023-06-25 18:24:30.097285: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
2023-06-25 11:24:32 default[20230625t180702]  2023-06-25 18:24:32.252226: I tensorflow/tsl/cuda/cudart_stub.cc:28] Could not find cuda drivers on your machine, GPU will not be used.
2023-06-25 11:24:34 default[20230625t180702]  2023-06-25 18:24:34.264702: I tensorflow/tsl/cuda/cudart_stub.cc:28] Could not find cuda drivers on your machine, GPU will not be used.
2023-06-25 11:24:34 default[20230625t180702]  2023-06-25 18:24:34.294337: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
2023-06-25 11:24:34 default[20230625t180702]  To enable the following instructions: AVX2 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.

I cannot find any other errors in my app besides this one, so I assume that this error is causing the application to fail and resulting in a "502 Bad Gateway" error.

This my app.yaml:

runtime: python
env: flex
entrypoint: daphne -p $PORT api.asgi:application

env_variables:
  DJANGO_SETTINGS_MODULE: "api.settings"

beta_settings:
  cloud_sql_instances: PROJECT_ID:REGION:INSTANCE_NAME

runtime_config:
  operating_system: "ubuntu22"
  runtime_version: "3.10"

Daphne worked fine without any errors, but it is unable to return anything.

2023-06-25 11:38:40 default[20230625t180702]  "GET /" 502
2023-06-25 11:38:51 default[20230625t180702]  "GET /admin" 502
2023-06-25 11:40:39 default[20230625t180702]  "GET /admin" 502
0

There are 0 answers