Check whether your GraphDef-interpreting binary is up to date with your GraphDef-generating binary.
阿新 • • 發佈:2020-12-14
技術標籤:Google Cloudgoogle cloudtensorflowpython
在使用Google Cloud Storage建立訓練version的時候死活不能建立,總是報錯如下
ERROR: (gcloud.ai-platform.versions.create) Create Version failed.
Bad model detected with error: "Failed to load model: Create kernel failed: Invalid argument: NodeDef mentions attr 'allowed_devices' not in Op<name=VarHandleOp; signature= -> resource:resource; attr=container:string,default=" "; attr=shared_name:string,default=""; attr=dtype:type; attr=shape:shape; is_stateful=true>; NodeDef: {{node SGD/decay}}. (Check whether your GraphDef-interpreting binary is up to date with your GraphDef-generating binary.).\nExecutor failed to create kernel. Invalid argument: NodeDef mentions attr 'allowed_devices' not in Op<name=VarHandleOp; signature= -> resource:resource; attr=container:string,default=" "; attr=shared_name:string,default=""; attr=dtype:type; attr=shape:shape; is_stateful=true>; NodeDef: {{node SGD/decay}}. (Check whether your GraphDef-interpreting binary is up to date with your GraphDef-generating binary.).\n\t [[SGD/decay]]\nLoading servable: {name: default version: 1} failed: Invalid argument: NodeDef mentions attr 'allowed_devices' not in Op<name=VarHandleOp; signature= -> resource:resource; attr=container:string,default=" "; attr=shared_name:string,default=""; attr=dtype:type; attr=shape:shape; is_stateful=true>; NodeDef: {{node SGD/decay}}. (Check whether your GraphDef-interpreting binary is up to date with your GraphDef-generating binary.).\n\t [[SGD/decay]]\n\n (Error code: 0)"
怎麼都沒找到相同問題的情況,只能試圖閱讀報錯資訊,拆成小資訊。然後注意到了這句:
(Check whether your GraphDef-interpreting binary is up to date with your GraphDef-generating binary.)
那就試圖解決這個問題,然後網上查詢可能是TensorFlow版本問題,比如有兩個版本,使用版本資訊不對等。然後就去翻程式碼,發現果然是的,我在前面使用了2.3的資訊,後面使用了2.1的版本,也是偷懶,覺得後面版本差別應該也不會有影響,結果就翻車了。
所以把兩個版本統一一下就好啦,記錄下防遺失~如果是自己電腦跑程式碼遇到這種情況就去看看自己的TensorFlow版本有沒有統一,有沒有兩個以上版本。