GoogleCloudPlatform / cloudml-samples

Cloud ML Engine repo. Please visit the new Vertex AI samples repo at https://github.com/GoogleCloudPlatform/vertex-ai-samples
https://cloud.google.com/ai-platform/docs/
Apache License 2.0
1.52k stars 859 forks source link

ERROR: (gcloud.ml-engine.local.predict) RuntimeError: Bad magic number in .pyc file #415

Closed gogasca closed 5 years ago

gogasca commented 5 years ago

Describe the bug

When running local-train.sh script I get:

ERROR: (gcloud.ml-engine.local.predict) RuntimeError: Bad magic number in .pyc file

What sample is this bug related to?

gcloud ai-platform local predict --model-dir=${MODEL_LOCATION} --json-instances=data/new-data.json

Source code / logs local-train.sh

ERROR: (gcloud.ml-engine.local.predict) RuntimeError: Bad magic number in .pyc file

To Reproduce Steps to reproduce the behavior: Run Census Template example using TF 1.13.1

gcloud ai-platform local predict --model-dir=${MODEL_LOCATION} --json-instances=data/new-data.json

or ml-engine gives same result

Expected behavior Get prediction

System Information

gogasca commented 5 years ago

Reference: https://stackoverflow.com/questions/48824381/gcloud-ml-engine-local-predict-runtimeerror-bad-magic-number-in-pyc-file Add --verbosity debug to command and delete the .pyc files in /$USER/google-cloud-sdk/lib/googlecloudsdk/command_lib/ml_engine/