What type of PR is this?
bug

What does this PR do / why do we need it:
Fix if Imagefolder input directory is not right, will occur out of memory error

Which issue(s) this PR fixes:

Fixes #I3N1NT:[MS][MD]Invalid file to allocate tensor memory error is change.

Special notes for your reviewers: