notAI-tech / NudeNet

Lightweight nudity detection
https://nudenet.notai.tech/
GNU Affero General Public License v3.0
1.76k stars 343 forks source link

ERROR: File name too long #56

Closed uBadRequest closed 3 years ago

uBadRequest commented 3 years ago

Describe the bug and error messages (if any)

I needed to recurse directories and after adding that, an error is occurring that states the file is too long.

    files = [os.path.join(dirpath, f)
        for dirpath, dirnames, files in os.walk(args.dir)
        for f in files if f.endswith('.{}'.format(args.ext))]

Could also do it like this

files = glob.glob(os.path.join(args.dir, "**/*." + args.ext), recursive=True)

**The code snippet which gave this error***

{'success': False, 'reason': "[Errno 36] File name too long: '/app/diskdisk/8_2020-11-04-17-40-53-886_50607d66-ce1b-413c-ad65-533991f2dfbc.inp/000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.f0008512.jpg'"} Specify versions of the following libraries I don't think the problem is with tensorflow or keras.

  1. nudenet: current version in Docker Hub
  2. tensorflow/ tensorflow-gpu:
  3. keras

Expected behavior

Filename not to have a bunch of 0's and cause a filename too long error.

Screenshots If applicable, add screenshots to help explain your problem.

bedapudi6788 commented 3 years ago

How many files were present in that request?

uBadRequest commented 3 years ago

There was only 305, but I have like 40 folders that contain 300~ images. I'm trying to run this against all of them. Don't want to accidentally upload an image of something that I wouldn't want to...

bedapudi6788 commented 3 years ago

Reducing the number of images in a single request will solve this issue. You will have to post the images in multiple batches.

bedapudi6788 commented 3 years ago

@uBadRequest please re-open if it does not work.