Failed attempts used to solve error:
- In requirements.txt changed the tensorflow to tensorflow-cpu but it didnt work
- Added the below flag to main.py yet it didnt work.
os.environ['CUDA_VISIBLE_DEVICES'] = ''
When I set tensorflow to tensorflow-cpu in requirements.txt and add the above flag then I get a new error:
ERROR:
(gcloud.functions.deploy) OperationError: code=3, message=Function failed on loading user code.
This is likely due to a bug in the user code.
Error message: 2023-08-20 04:00:51.604711: I tensorflow/core/platform/cpu_feature_guard.cc:182]
This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 AVX512F FMA, in other
operations, rebuild TensorFlow with the appropriate compiler flags..
in-depth troubleshooting documentation.
What I want is simply that the model is deployed using Vertex AI and the cloud function will help
the user pass a GCP bucket file path to image. The function will then download the image and create
a tensor and then pass it to the Model to find the prediction on it.
Can someone please help to solve this error.