Giter Club home page Giter Club logo

Comments (6)

Ijustakid avatar Ijustakid commented on May 20, 2024

mobilenet-v1.yml

from mace-models.

lee-bin avatar lee-bin commented on May 20, 2024

@Ijustakid 在导出TensorFlow模型的时候需要设置is_training为false

from mace-models.

Ijustakid avatar Ijustakid commented on May 20, 2024

@Ijustakid 在导出TensorFlow模型的时候需要设置is_training为false
convert_pb.py中:

            out=sess.run(output_tensor_name, feed_dict={input_image_tensor: im,
                                                        input_keep_prob_tensor:1.0,
                                                        input_is_training_tensor:False})

已把is_training_tensor设为False
另:keep_prob的placeholder如何处理?

十分感谢!

br

from mace-models.

Ijustakid avatar Ijustakid commented on May 20, 2024

@Ijustakid 在导出TensorFlow模型的时候需要设置is_training为false

convert_pb.py

`input_image_tensor = sess.graph.get_tensor_by_name("input:0")
input_keep_prob_tensor = sess.graph.get_tensor_by_name("keep_prob:0")
input_is_training_tensor = sess.graph.get_tensor_by_name("is_training:0")

        # 定义输出的张量名称
        output_tensor_name = sess.graph.get_tensor_by_name("MobilenetV1/Logits/SpatialSqueeze:0")

        # 读取测试图片
        im=read_image(image_path,resize_height,resize_width,normalization=True)
        im=im[np.newaxis,:]
        # 测试读出来的模型是否正确,注意这里传入的是输出和输入节点的tensor的名字,不是操作节点的名字
        # out=sess.run("InceptionV3/Logits/SpatialSqueeze:0", feed_dict={'input:0': im,'keep_prob:0':1.0,'is_training:0':False})
        out=sess.run(output_tensor_name, feed_dict={input_image_tensor: im,
                                                    input_keep_prob_tensor:1.0,
                                                    input_is_training_tensor:False})`

from mace-models.

lee-bin avatar lee-bin commented on May 20, 2024

没看到模型构建和导出的代码,只看到了session.run运行的代码,需要在模型构建时设置is_training和keep_prob

from mace-models.

Ijustakid avatar Ijustakid commented on May 20, 2024

没看到模型构建和导出的代码,只看到了session.run运行的代码,需要在模型构建时设置is_training和keep_prob

i will try it, thanks!

from mace-models.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.