TensorFlow v1.10+ load SavedModel with different device placement or manually set dynamic device placement?

南楼画角 提交于 2019-12-01 11:53:55

I am doing some research on this topic recently and to my knowledge, your question 1 can work only if you clear all devices when you export the model in the original tensorflow code, with flag clear_devices=True.

In my own code, it looks like

builder = tf.saved_model.builder.SavedModelBuilder('osvos_saved')
builder.add_meta_graph_and_variables(sess, ['serve'], clear_devices=True)
builder.save()

If you only have a exported model, seems not possible. You can refer to this issue.

I'm currently trying to find a way to fix this, as stated in my stackoverflow question. Hope the workaround can help you.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!