Gcloud ai-platform local predict Error: gcloud crashed (PermissionError): [WinError 5] Access is denied

332 views Asked by At

I was trying to run a command to test local predict in my computer. However, the command failed every time with this error.

ERROR: gcloud crashed (PermissionError): [WinError 5] Access is denied

This is the command:

gcloud ai-platform local predict --model-dir model_final --json-instances image_b64.json --framework tensorflow

I am positive 101% positive that I have followed everything in the doc by Google.

  1. First, the command required a model file to be saved in TensorFlow SavedModel format, which, since I use Keras, I can just do model.save("model_final").

If you have used Keras for training, use tf.keras.Model.save to export a SavedModel

So I did, at it only output a single file, so I can only assume it's the file to be placed in the --model-dir parameter. I admit doing model.save("model_final") created a file, not a dir, which is a bit weird but the document for Keras just said use that so there is no way I could be wrong.

And also:

If you export your SavedModel using tf.keras.Model.save, then you do not need to specify a serving input function.

If you export a SavedModel from tf.keras or from a TensorFlow estimator, the exported graph is ready for serving by default.

  1. The "image_b64.json" file follows this format:

{"image_bytes":{"b64": base64_jpeg_data )}}

So after 3 hours and having followed everything required by Google, and somehow the gloud still throws me that error. And, yes, of course I have run the command line under Administrator Mode. I also tried it in two of my computers, and I got the same error. I am using Windows, Tensorflow 1.15.

Can anyone point out what is the problem with my implementation, or Google Doc/Keras is just lack lustering. Thank you.

0

There are 0 answers