tensorflowjs_converter: SavedModel file does not exist at:











up vote
0
down vote

favorite












I am following the instructions here to import my Tensorflow model generated using Python into Tensorflow.js.



The model is created using a tf.estimator API, which auto saves the model files according to this page.



After installing tensorflowjs using pip, I get the following error when running the convert script:



$ tensorflowjs_converter     --input_format=tf_saved_model     --output_node_names='DeepWater'     /home/sterengiannini/deepwater/model-js-import-test     /home/sterengiannini/deepwater/web-model
Using TensorFlow backend.
Traceback (most recent call last):
File "/usr/local/bin/tensorflowjs_converter", line 11, in <module>
sys.exit(main())
File "/home/sterengiannini/.local/lib/python2.7/site-packages/tensorflowjs/converters/converter.py", line 317, in main
strip_debug_ops=FLAGS.strip_debug_ops)
File "/home/sterengiannini/.local/lib/python2.7/site-packages/tensorflowjs/converters/tf_saved_model_conversion.py", line 289, in convert_tf_saved_model
input_saved_model_dir=saved_model_dir)
File "/home/sterengiannini/.local/lib/python2.7/site-packages/tensorflow/python/tools/freeze_graph.py", line 338, in freeze_graph
input_saved_model_dir, saved_model_tags).graph_def
File "/home/sterengiannini/.local/lib/python2.7/site-packages/tensorflow/python/tools/saved_model_utils.py", line 42, in get_meta_graph_def
saved_model = reader.read_saved_model(saved_model_dir)
File "/home/sterengiannini/.local/lib/python2.7/site-packages/tensorflow/contrib/saved_model/python/saved_model/reader.py", line 55, in read_saved_model
raise IOError("SavedModel file does not exist at: %s" % saved_model_dir)
IOError: SavedModel file does not exist at: /home/sterengiannini/deepwater/model-js-import-test


Here are the files present in the model folder:



$ ls model-js-import-test/
graph.pbtxt model.ckpt-312.data-00000-of-00001 model.ckpt-312.index model.ckpt-312.meta









share|improve this question




























    up vote
    0
    down vote

    favorite












    I am following the instructions here to import my Tensorflow model generated using Python into Tensorflow.js.



    The model is created using a tf.estimator API, which auto saves the model files according to this page.



    After installing tensorflowjs using pip, I get the following error when running the convert script:



    $ tensorflowjs_converter     --input_format=tf_saved_model     --output_node_names='DeepWater'     /home/sterengiannini/deepwater/model-js-import-test     /home/sterengiannini/deepwater/web-model
    Using TensorFlow backend.
    Traceback (most recent call last):
    File "/usr/local/bin/tensorflowjs_converter", line 11, in <module>
    sys.exit(main())
    File "/home/sterengiannini/.local/lib/python2.7/site-packages/tensorflowjs/converters/converter.py", line 317, in main
    strip_debug_ops=FLAGS.strip_debug_ops)
    File "/home/sterengiannini/.local/lib/python2.7/site-packages/tensorflowjs/converters/tf_saved_model_conversion.py", line 289, in convert_tf_saved_model
    input_saved_model_dir=saved_model_dir)
    File "/home/sterengiannini/.local/lib/python2.7/site-packages/tensorflow/python/tools/freeze_graph.py", line 338, in freeze_graph
    input_saved_model_dir, saved_model_tags).graph_def
    File "/home/sterengiannini/.local/lib/python2.7/site-packages/tensorflow/python/tools/saved_model_utils.py", line 42, in get_meta_graph_def
    saved_model = reader.read_saved_model(saved_model_dir)
    File "/home/sterengiannini/.local/lib/python2.7/site-packages/tensorflow/contrib/saved_model/python/saved_model/reader.py", line 55, in read_saved_model
    raise IOError("SavedModel file does not exist at: %s" % saved_model_dir)
    IOError: SavedModel file does not exist at: /home/sterengiannini/deepwater/model-js-import-test


    Here are the files present in the model folder:



    $ ls model-js-import-test/
    graph.pbtxt model.ckpt-312.data-00000-of-00001 model.ckpt-312.index model.ckpt-312.meta









    share|improve this question


























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I am following the instructions here to import my Tensorflow model generated using Python into Tensorflow.js.



      The model is created using a tf.estimator API, which auto saves the model files according to this page.



      After installing tensorflowjs using pip, I get the following error when running the convert script:



      $ tensorflowjs_converter     --input_format=tf_saved_model     --output_node_names='DeepWater'     /home/sterengiannini/deepwater/model-js-import-test     /home/sterengiannini/deepwater/web-model
      Using TensorFlow backend.
      Traceback (most recent call last):
      File "/usr/local/bin/tensorflowjs_converter", line 11, in <module>
      sys.exit(main())
      File "/home/sterengiannini/.local/lib/python2.7/site-packages/tensorflowjs/converters/converter.py", line 317, in main
      strip_debug_ops=FLAGS.strip_debug_ops)
      File "/home/sterengiannini/.local/lib/python2.7/site-packages/tensorflowjs/converters/tf_saved_model_conversion.py", line 289, in convert_tf_saved_model
      input_saved_model_dir=saved_model_dir)
      File "/home/sterengiannini/.local/lib/python2.7/site-packages/tensorflow/python/tools/freeze_graph.py", line 338, in freeze_graph
      input_saved_model_dir, saved_model_tags).graph_def
      File "/home/sterengiannini/.local/lib/python2.7/site-packages/tensorflow/python/tools/saved_model_utils.py", line 42, in get_meta_graph_def
      saved_model = reader.read_saved_model(saved_model_dir)
      File "/home/sterengiannini/.local/lib/python2.7/site-packages/tensorflow/contrib/saved_model/python/saved_model/reader.py", line 55, in read_saved_model
      raise IOError("SavedModel file does not exist at: %s" % saved_model_dir)
      IOError: SavedModel file does not exist at: /home/sterengiannini/deepwater/model-js-import-test


      Here are the files present in the model folder:



      $ ls model-js-import-test/
      graph.pbtxt model.ckpt-312.data-00000-of-00001 model.ckpt-312.index model.ckpt-312.meta









      share|improve this question















      I am following the instructions here to import my Tensorflow model generated using Python into Tensorflow.js.



      The model is created using a tf.estimator API, which auto saves the model files according to this page.



      After installing tensorflowjs using pip, I get the following error when running the convert script:



      $ tensorflowjs_converter     --input_format=tf_saved_model     --output_node_names='DeepWater'     /home/sterengiannini/deepwater/model-js-import-test     /home/sterengiannini/deepwater/web-model
      Using TensorFlow backend.
      Traceback (most recent call last):
      File "/usr/local/bin/tensorflowjs_converter", line 11, in <module>
      sys.exit(main())
      File "/home/sterengiannini/.local/lib/python2.7/site-packages/tensorflowjs/converters/converter.py", line 317, in main
      strip_debug_ops=FLAGS.strip_debug_ops)
      File "/home/sterengiannini/.local/lib/python2.7/site-packages/tensorflowjs/converters/tf_saved_model_conversion.py", line 289, in convert_tf_saved_model
      input_saved_model_dir=saved_model_dir)
      File "/home/sterengiannini/.local/lib/python2.7/site-packages/tensorflow/python/tools/freeze_graph.py", line 338, in freeze_graph
      input_saved_model_dir, saved_model_tags).graph_def
      File "/home/sterengiannini/.local/lib/python2.7/site-packages/tensorflow/python/tools/saved_model_utils.py", line 42, in get_meta_graph_def
      saved_model = reader.read_saved_model(saved_model_dir)
      File "/home/sterengiannini/.local/lib/python2.7/site-packages/tensorflow/contrib/saved_model/python/saved_model/reader.py", line 55, in read_saved_model
      raise IOError("SavedModel file does not exist at: %s" % saved_model_dir)
      IOError: SavedModel file does not exist at: /home/sterengiannini/deepwater/model-js-import-test


      Here are the files present in the model folder:



      $ ls model-js-import-test/
      graph.pbtxt model.ckpt-312.data-00000-of-00001 model.ckpt-312.index model.ckpt-312.meta






      tensorflow tensorflowjs-converter






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 19 at 0:49

























      asked Nov 19 at 0:38









      Steren

      2,0281422




      2,0281422
























          1 Answer
          1






          active

          oldest

          votes

















          up vote
          1
          down vote



          accepted










          It looks like the model was not saved in the right format. You should expect something like the following in your model folder (see Structure of a SavedModel directory):



          assets/
          assets.extra/
          variables/
          variables.data-?????-of-?????
          variables.index
          saved_model.pb|saved_model.pbtxt


          For, example, if you are using tf.estimator API, you need to export the model with the following (see Using SavedModel with Estimators):



          estimator.export_savedmodel(export_dir_base, serving_input_receiver_fn)





          share|improve this answer





















            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














             

            draft saved


            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53366921%2ftensorflowjs-converter-savedmodel-file-does-not-exist-at%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            1
            down vote



            accepted










            It looks like the model was not saved in the right format. You should expect something like the following in your model folder (see Structure of a SavedModel directory):



            assets/
            assets.extra/
            variables/
            variables.data-?????-of-?????
            variables.index
            saved_model.pb|saved_model.pbtxt


            For, example, if you are using tf.estimator API, you need to export the model with the following (see Using SavedModel with Estimators):



            estimator.export_savedmodel(export_dir_base, serving_input_receiver_fn)





            share|improve this answer

























              up vote
              1
              down vote



              accepted










              It looks like the model was not saved in the right format. You should expect something like the following in your model folder (see Structure of a SavedModel directory):



              assets/
              assets.extra/
              variables/
              variables.data-?????-of-?????
              variables.index
              saved_model.pb|saved_model.pbtxt


              For, example, if you are using tf.estimator API, you need to export the model with the following (see Using SavedModel with Estimators):



              estimator.export_savedmodel(export_dir_base, serving_input_receiver_fn)





              share|improve this answer























                up vote
                1
                down vote



                accepted







                up vote
                1
                down vote



                accepted






                It looks like the model was not saved in the right format. You should expect something like the following in your model folder (see Structure of a SavedModel directory):



                assets/
                assets.extra/
                variables/
                variables.data-?????-of-?????
                variables.index
                saved_model.pb|saved_model.pbtxt


                For, example, if you are using tf.estimator API, you need to export the model with the following (see Using SavedModel with Estimators):



                estimator.export_savedmodel(export_dir_base, serving_input_receiver_fn)





                share|improve this answer












                It looks like the model was not saved in the right format. You should expect something like the following in your model folder (see Structure of a SavedModel directory):



                assets/
                assets.extra/
                variables/
                variables.data-?????-of-?????
                variables.index
                saved_model.pb|saved_model.pbtxt


                For, example, if you are using tf.estimator API, you need to export the model with the following (see Using SavedModel with Estimators):



                estimator.export_savedmodel(export_dir_base, serving_input_receiver_fn)






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 19 at 2:11









                Anne Menini

                261




                261






























                     

                    draft saved


                    draft discarded



















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53366921%2ftensorflowjs-converter-savedmodel-file-does-not-exist-at%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Ottavio Pratesi

                    Tricia Helfer

                    15 giugno