GantMan / nsfw_model

Keras model of NSFW detector
Other
1.8k stars 279 forks source link

New version is broken #55

Closed remusnegrota closed 4 years ago

remusnegrota commented 4 years ago

Getting this error: ImportError: cannot import name 'NSFWDetector' from 'nsfw_detector' (unknown location)

TechnikEmpire commented 4 years ago

Yikes, I might have done this.

TechnikEmpire commented 4 years ago

@remusnegrota Where are you seeing this error? A stack trace + command used would help. I can't even find an import of NSFWDetector, its only defined nsfw_model\tf1\nsfw_detector\__init__.py

remusnegrota commented 4 years ago

@TechnikEmpire If you simply import the package as before and as it is stated in the Usage readme, like so: from nsfw_detector import NSFWDetector

then it throws that error directly, no other stack trace ImportError: cannot import name 'NSFWDetector' from 'nsfw_detector' (unknown location)

Maybe its a documentation issue and the way you need to import the package changed, in that case just update the Usage instructions.

ezavesky commented 4 years ago

The new version does need a little work to fix the package and documentation, but here's how to run it. Most notably, the simple run directions are out of date.

git clone git@github.com:GantMan/nsfw_model.git
cd nsfw_model/nsfw_detector
(download model from release, unzip model, assume it's in `mobilenet_v2_140_224`)
(download images, place them in `images`)
python predict.py --saved_model_path mobilenet_v2_140_224 --image_dir images
ezavesky commented 4 years ago

BTW, I will try to push a change for this tonight.