Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValueError: saved_model_path must be the valid directory of a saved model to load. #163

Open
chaserRen opened this issue Jul 10, 2024 · 0 comments

Comments

@chaserRen
Copy link

chaserRen commented Jul 10, 2024

Hi, Here is my code:

from nsfw_detector import predict
model = predict.load_model("./nvme/renzhifei/nsfw/model/mobilenetv2.h5")
probs = predict.classify(model, '/nvme/renzhifei/nsfw/images_ko/')
print(probs)

I downloaded .h5 file from this url
load1 png
I unzipped the file and renamed file “saved_model_weights.h5” as "mobilenetv2.h5"

I put .h5 file in the path: "./nvme/renzhifei/nsfw/model/"
nsfw png

When I run my python file, it notes as following:
2024-07-10 16:51:02.466112: I tensorflow/core/util/port.cc:110] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable TF_ENABLE_ONEDNN_OPTS=0.
2024-07-10 16:51:02.468141: I tensorflow/tsl/cuda/cudart_stub.cc:28] Could not find cuda drivers on your machine, GPU will not be used.
2024-07-10 16:51:02.514406: I tensorflow/tsl/cuda/cudart_stub.cc:28] Could not find cuda drivers on your machine, GPU will not be used.
2024-07-10 16:51:02.514847: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 AVX512F AVX512_VNNI FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
2024-07-10 16:51:03.087415: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
Traceback (most recent call last):
File "demo.py", line 3, in
model = predict.load_model("./nvme/renzhifei/nsfw/model/mobilenetv2.h5")
File "/home/qa-caif-cicd/renzhifei/nsfw_model/nsfw_detector/predict.py", line 54, in load_model
raise ValueError("saved_model_path must be the valid directory of a saved model to load.")
ValueError: saved_model_path must be the valid directory of a saved model to load.

I want to kown how to solve this problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant