Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用spark-scala调用tensorflow2.0训练好的模型,mac本地读取不了模型 #78

Open
chlyzzo opened this issue Dec 4, 2020 · 0 comments

Comments

@chlyzzo
Copy link

chlyzzo commented Dec 4, 2020

用tensorflow训练了个lr模型,保存在mac本地,显示成功:
image

然后,用spark-scala进行读取模型,一直显示错误:
20/12/04 17:08:23 INFO BlockManager: Using org.apache.spark.storage.RandomBlockReplicationPolicy for block replication policy
20/12/04 17:08:23 INFO BlockManagerMaster: Registering BlockManager BlockManagerId(driver, 172.18.20.248, 54070, None)
20/12/04 17:08:23 INFO BlockManagerMasterEndpoint: Registering block manager 172.18.20.248:54070 with 912.3 MB RAM, BlockManagerId(driver, 172.18.20.248, 54070, None)
20/12/04 17:08:23 INFO BlockManagerMaster: Registered BlockManager BlockManagerId(driver, 172.18.20.248, 54070, None)
20/12/04 17:08:23 INFO BlockManager: Initialized BlockManager: BlockManagerId(driver, 172.18.20.248, 54070, None)
2020-12-04 17:08:23.823963: I tensorflow/cc/saved_model/loader.cc:242] Loading SavedModel with tags: { serve }; from: /Users/huwenhao02/eclipse-workspace/pythonWorks/tensorflow-works/data/linear_model/1
2020-12-04 17:08:23.825520: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.2 AVX AVX2 FMA
2020-12-04 17:08:23.832894: I tensorflow/cc/saved_model/loader.cc:291] SavedModel load for tags { serve }; Status: fail. Took 8992 microseconds.
Exception in thread "main" org.tensorflow.TensorFlowException: Op type not registered 'StatefulPartitionedCall' in binary running on BDSHYF000120942. Make sure the Op and Kernel are registered in the binary running in this process. Note that if you are loading a saved graph which used ops from tf.contrib, accessing (e.g.) tf.contrib.resampler should be done before importing the graph, as contrib ops are lazily registered when the module is first accessed.
at org.tensorflow.SavedModelBundle.load(Native Method)
at org.tensorflow.SavedModelBundle.load(SavedModelBundle.java:39)
at tensorflow.UserTfEaxmple$.main(UserTfEaxmple.scala:20)
at tensorflow.UserTfEaxmple.main(UserTfEaxmple.scala)
20/12/04 17:08:23 INFO SparkContext: Invoking stop() from shutdown hook
20/12/04 17:08:23 INFO SparkUI: Stopped Spark web UI at http://172.18.20.248:4040
20/12/04 17:08:23 INFO MapOutputTrackerMasterEndpoint: MapOutputTrackerMasterEndpoint stopped!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant