helq / ml_hw3

Class assignment - Classifying from small-NORB dataset
1 stars 0 forks source link

Error -3 while decompressing data: invalid block type #1

Closed LiWentomng closed 6 years ago

LiWentomng commented 6 years ago

When I compile the loaddataset.py,the erro occured. Call for help!

E:/python_work/small_norb-master/readsmallnorb/loaddataset.py:29: DeprecationWarning: The binary mode of fromstring is deprecated, as it behaves surprisingly on unicode inputs. Use frombuffer instead set[100i:100(i+1)] = np.fromstring( f.read(100296*96), dtype='<B' ).reshape((100,2,96,96)) Traceback (most recent call last):

File "", line 1, in runfile('E:/python_work/small_norb-master/read_smallnorb/loaddataset.py', wdir='E:/python_work/small_norb-master/read_smallnorb')

File "E:\ProgramFiles_x86\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 710, in runfile execfile(filename, namespace)

File "E:\ProgramFiles_x86\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 101, in execfile exec(compile(f.read(), filename, 'exec'), namespace)

File "E:/python_work/small_norb-master/read_smallnorb/loaddataset.py", line 71, in training_imgs = load_images('testing')

File "E:/python_work/small_norb-master/read_smallnorb/loaddataset.py", line 29, in loadimages set[100i:100(i+1)] = np.fromstring( f.read(100296*96), dtype='<B' ).reshape((100,2,96,96))

File "E:\ProgramFiles_x86\Anaconda3\lib\gzip.py", line 276, in read return self._buffer.read(size)

File "E:\ProgramFiles_x86\Anaconda3\lib_compression.py", line 68, in readinto data = self.read(len(byte_view))

File "E:\ProgramFiles_x86\Anaconda3\lib\gzip.py", line 471, in read uncompress = self._decompressor.decompress(buf, size)

error: Error -3 while decompressing data: invalid block type

helq commented 6 years ago

Did you download the dataset? You can download it from https://cs.nyu.edu/%7Eylclab/data/norb-v1.0-small/. All mat.gz must be inside the folder dataset (if it doesn't exists, create it).

I just wrote a README, check it, and tell me if there is something missing.

LiWentomng commented 6 years ago

Thank you very much! I found it that my small_norb dataset was damaged .I redownload the dataset from the link you gived. It worked! I have another question. The channels or depth of the image is ? one,two or three?

helq commented 6 years ago

The images from the NORB dataset have two channels, each channel is a grey image from one of two different angles, i.e., all images are stereoscopic, taken with two cameras, just like our eyes.

LiWentomng commented 6 years ago

Thank you very much!I got it!

helq commented 6 years ago

Ok, so I guess everything is working properly. I'm closing the issue.