无法在我的tf图元文件上使用freeze_graph.py

时间:2019-06-13 01:06:58

标签: python tensorflow

我在TF文件中使用了以下命令来生成.meta文件。

init = tf.global_variables_initializer()
saver = tf.train.Saver()
saver.save(sess, 'my_test_model'+str(i))

然后它生成4个输出:检查点,.index,.meta,.data-00000-of-00001文件

然后我在与.meta文件相同的路径上使用了freeze.graph.py文件,并使用以下命令,并看到以下错误:

user1:~/test$ python freeze_graph.py --input_graph graph.pbtxt --input_checkpoint my_test_model1 --output_nodes_names output_my_test_model1 --output_graph /tmp/out
I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcublas.so.8.0 locally
I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcudnn.so.5 locally
I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcufft.so.8.0 locally
I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcuda.so.1 locally
I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcurand.so.8.0 locally
**Traceback (most recent call last):
  File "freeze_graph.py", line 56, in <module>
    from tensorflow.python.tools import saved_model_utils
ImportError: cannot import name saved_model_utils**

0 个答案:

没有答案