Forums

Using Tensorflow gives 502 Bad gateway error

I have code in the backend of django project which is hosted on PythonAnywhere that uses tensorflow. However, I am getting this error in server log and a 502 Bad Gateway server error

2020-08-01 00:48:36 2020-08-01 00:48:36.440295: W

tensorflow/stream_executor/platform/default/dso_loader.cc:59] Could not load dynamic library 'libcuda.so.1'; dlerror: libcuda.so.1: cannot open shared object file: No such file or directory 2020-08-01 00:48:36 2020-08-01 00:48:36.440328: W tensorflow/stream_executor/cuda/cuda_driver.cc:312] failed call to cuInit: UNKNOWN ERROR (303) 2020-08-01 00:48:36 2020-08-01 00:48:36.440338: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:156] kernel driver does not appear to be running on this host (green-liveweb12): /proc/driver/nvidia/version does not exist 2020-08-01 00:48:36 2020-08-01 00:48:36.440538: I tensorflow/core/platform/cpu_feature_guard.cc:142] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN)to use the following CPU instructions in performance-critical operations: AVX2 AVX512F FMA#012To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags. 2020-08-01 00:48:36 2020-08-01 00:48:36.447533: I tensorflow/core/platform/profile_utils/cpu_utils.cc:104] CPU Frequency: 2300045000 Hz 2020-08-01 00:48:36 2020-08-01 00:48:36.447779: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0xb5fce60 initialized for platform Host (this does not guarantee that XLA will be used). Devices: 2020-08-01 00:48:36 2020-08-01 00:48:36.447793: I tensorflow/compiler/xla/service/service.cc:176] StreamExecutor device (0): Host, Default Version 2020-08-01 00:48:37 2020-08-01 00:48:37.627991: F tensorflow/core/platform/env.cc:351] Check failed: -1 != path_length (-1 vs. -1) 2020-08-01 00:48:38 DAMN ! worker 1 (pid: 3) died, killed by signal 6 :( trying respawn ... 2020-08-01 00:48:38 Respawned uWSGI worker 1 (new pid: 31) 2020-08-01 00:48:38 spawned 2 offload threads for uWSGI worker 1

Please let me know how to use tensorflow on pythonAnywhere or any configurations i have to add.

Thanks

Hmm, does follow these instructions for a notebook work for you?

I'm having the same error.

"This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN)to use the following CPU instructions in performance-critical operations" even though it runs fine in other environments.

I've just signed up for this service, and it seems good, but not sure how to solve this, as installed Tensorflow into the instance.

do you have this error Could not load dynamic library 'libcuda.so.1';? Or the error / warning that you quoted?

I dropped to version 3.6 of python and it's working fine. I think the issue was getting the right version of Tensorflow to work with the VM.

I read that it was a compatibility issue, but sure I can work with the pre-installed version on 3.6 for now.

That's interesting -- glad to hear you got it working, anyway! Where did you read about the compatibility issue?