GantMan / GantMan/nsfw_model

244 - 299 problem

Open
#152 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
2.1k
Forks
303
PR merge metrics
No merged PRs in 30d

Description

Hello

ValueError: Input 0 of layer "model_1" is incompatible with the layer: expected shape=(None, 299, 299, 3), found shape=(None, 224, 224, 3)

im sure that my images are 299 299
i also tried :

from nsfw_detector import predict
model = predict.load_model('models/nsfw.299x299.h5')
predict.classify(model, 'test/frames/', 299)

or

from nsfw_detector import predict
model = predict.load_model('models/nsfw.299x299.h5')

# Predict single image
predict.classify(model, 'test/frames/output_0045.jpg', 299)

output :
:38] TF-TRT Warning: Could not find TensorRT
test/frames/output_0045.jpg size: (299, 299)
1/1 [==============================] - 2s 2s/step
[root@server-194-5-205-78 nsfw_model]#

but it did not print the result and only printed images name and , 299 thats all
any trick to solve it ?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the predict.classify calls shown for models/nsfw.299x299.h5 and the 299x299 image paths. Reproduce the shape mismatch and inspect what predict.classify returns or prints, then verify the result is exposed for both a directory and a single image. Done means the 299x299 model accepts the input and classification output is clearly available.

Written by the indexing model from the issue text.

Assessment

Tech stack
keras, python, tensorflow
Domain
machine-learning
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.