libffcv / ffcv

FFCV: Fast Forward Computer Vision (and other ML workloads!)
https://ffcv.io
Apache License 2.0
2.8k stars 180 forks source link

Imagenet negative dimensions error #243

Open rahimentezari opened 1 year ago

rahimentezari commented 1 year ago

Hi I tried to use the imagenet example and fed my imagenet directory as path to ImageFolder to create my_dataset. However I am getting the following error (with no more details):

Traceback (most recent call last): File "/opt/conda/envs/ffcv/lib/python3.9/site-packages/ffcv/writer.py", line 112, in worker_job_indexed_dataset handle_sample(sample, dest_ix, field_names, metadata, allocator, fields) File "/opt/conda/envs/ffcv/lib/python3.9/site-packages/ffcv/writer.py", line 50, in handle_sample field.encode(destination, field_value, allocator.malloc) File "/opt/conda/envs/ffcv/lib/python3.9/site-packages/ffcv/fields/rgb_image.py", line 362, in encode destination['data_ptr'], storage = malloc(image.nbytes) File "/opt/conda/envs/ffcv/lib/python3.9/site-packages/ffcv/memory_allocator.py", line 43, in malloc self.flush_page() File "/opt/conda/envs/ffcv/lib/python3.9/site-packages/ffcv/memory_allocator.py", line 101, in flush_page self.fp.write(np.zeros(null_bytes_to_write, dtype='<u1').tobytes()) ValueError: negative dimensions are not allowed

daixiangzi commented 7 months ago

+1