Git Product home page Git Product logo

Comments (16)

yinguobing avatar yinguobing commented on July 24, 2024

百度云盘的两个链接一个是checkpoint,一个是SavedModel。你用的是哪一个呀?

from facial-landmark-detection-hrnet.

z2kp48 avatar z2kp48 commented on July 24, 2024

SavedModel那一个。

from facial-landmark-detection-hrnet.

yinguobing avatar yinguobing commented on July 24, 2024

可以列出pb文件的完整路径吗?有可能是路径的问题。

from facial-landmark-detection-hrnet.

z2kp48 avatar z2kp48 commented on July 24, 2024

Construct a face detector.

detector_face = Detector('assets/face_model/saved_model.pb')

# Restore the model.
model = tf.keras.models.load_model("./exported/hrnetv2")

谢谢您的回复,但是我不确定是将下载的模型放到哪句代码中。

from facial-landmark-detection-hrnet.

z2kp48 avatar z2kp48 commented on July 24, 2024

我以刚才的代码运行后,出现这种情况。
Traceback (most recent call last):
File "C:/Users/RPPG/Desktop/pyCode/facial-landmark-detection-hrnet-master/predict.py", line 34, in
detector_face = Detector('assets/face_model/saved_model.pb')
File "C:\Users\RPPG\Desktop\pyCode\facial-landmark-detection-hrnet-master\face_detector\detector.py", line 33, in init
imported = tf.saved_model.load(saved_model)
File "C:\Users\RPPG\Anaconda3\envs\ippg\lib\site-packages\tensorflow\python\saved_model\load.py", line 859, in load
return load_internal(export_dir, tags, options)["root"]
File "C:\Users\RPPG\Anaconda3\envs\ippg\lib\site-packages\tensorflow\python\saved_model\load.py", line 871, in load_internal
loader_impl.parse_saved_model_with_debug_info(export_dir))
File "C:\Users\RPPG\Anaconda3\envs\ippg\lib\site-packages\tensorflow\python\saved_model\loader_impl.py", line 56, in parse_saved_model_with_debug_info
saved_model = _parse_saved_model(export_dir)
File "C:\Users\RPPG\Anaconda3\envs\ippg\lib\site-packages\tensorflow\python\saved_model\loader_impl.py", line 111, in parse_saved_model
raise IOError("SavedModel file does not exist at: %s/{%s|%s}" %
OSError: SavedModel file does not exist at: assets/face_model/saved_model.pb/{saved_model.pbtxt|saved_model.pb}

Process finished with exit code 1

而且从github上下载代码后,我将asset文件中的原本的模型和变量改成的百度云盘中的模型和变量,不知道这样的操作是否正确。

from facial-landmark-detection-hrnet.

yinguobing avatar yinguobing commented on July 24, 2024

GitHub上下载的代码先不做任何改动。留意这行代码:

model = tf.keras.models.load_model("./exported/hrnetv2")

其中暗含了SavedModel应该存放的位置。你可以把这里的相对路径改为你计算机上的绝对路径。

我留意到你使用的应该是Windows操作系统,注意它的路径表述与Linux不同。所以你可能还需要把检测器加载的文件路径也检查一下:

detector_face = Detector('assets/face_model/saved_model.pb')

from facial-landmark-detection-hrnet.

z2kp48 avatar z2kp48 commented on July 24, 2024

在使用绝对路径后,还是会报错,跟之前的错误是一样的。
File "C:/Users/RPPG/Desktop/pyCode/landmark/predict.py", line 34, in
detector_face = Detector('assets/face_model/saved_model')
File "C:\Users\RPPG\Desktop\pyCode\landmark\face_detector\detector.py", line 33, in init
imported = tf.saved_model.load(saved_model)
File "C:\Users\RPPG\Anaconda3\envs\ippg\lib\site-packages\tensorflow\python\saved_model\load.py", line 859, in load
return load_internal(export_dir, tags, options)["root"]
File "C:\Users\RPPG\Anaconda3\envs\ippg\lib\site-packages\tensorflow\python\saved_model\load.py", line 871, in load_internal
loader_impl.parse_saved_model_with_debug_info(export_dir))
File "C:\Users\RPPG\Anaconda3\envs\ippg\lib\site-packages\tensorflow\python\saved_model\loader_impl.py", line 56, in parse_saved_model_with_debug_info
saved_model = _parse_saved_model(export_dir)
File "C:\Users\RPPG\Anaconda3\envs\ippg\lib\site-packages\tensorflow\python\saved_model\loader_impl.py", line 111, in parse_saved_model
raise IOError("SavedModel file does not exist at: %s/{%s|%s}" %
OSError: SavedModel file does not exist at: assets/face_model/saved_model/{saved_model.pbtxt|saved_model.pb}

Process finished with exit code 1

在网上查询错误原因后,将tensorflow改成了gpu版本,也是不对的。

我所有的错做过程如下:
在github上下载源代码。然后在github上下载models文件夹和face-detector文件夹所需要的代码。然后在百度云盘下载提供的已经训练好的model。
detector_face = Detector('assets/face_model/saved_model.pb')
这里使用的是原文件所提供的model路径
model = tf.keras.models.load_model("./exported/hrnetv2")
这里使用了从百度云盘所使用的model路径

真的很感谢您能在百忙之中回复我的信息。

from facial-landmark-detection-hrnet.

z2kp48 avatar z2kp48 commented on July 24, 2024

非常感谢,我重新下载了一遍代码之后问题解决了,谢谢

from facial-landmark-detection-hrnet.

yinguobing avatar yinguobing commented on July 24, 2024

客气了。有时间的话可以学习一下Git,这样遇到的问题会少很多。

from facial-landmark-detection-hrnet.

anil-bit avatar anil-bit commented on July 24, 2024

hi ,really sorry to disturb you but i have already downloaded from baidu cloud disk but cannot find "model.pbtxt|saved_model.pb"

from facial-landmark-detection-hrnet.

anil-bit avatar anil-bit commented on July 24, 2024

Screenshot_20220517_102730

from facial-landmark-detection-hrnet.

yinguobing avatar yinguobing commented on July 24, 2024

@anil-bit Please download the checkpoint file from GoogleDrive.

from facial-landmark-detection-hrnet.

anil-bit avatar anil-bit commented on July 24, 2024

谢谢你

from facial-landmark-detection-hrnet.

yinguobing avatar yinguobing commented on July 24, 2024

谢谢你

😃

from facial-landmark-detection-hrnet.

anil-bit avatar anil-bit commented on July 24, 2024

image

from facial-landmark-detection-hrnet.

anil-bit avatar anil-bit commented on July 24, 2024

使用哪一个?

from facial-landmark-detection-hrnet.

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.