Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zlib.error: Error -2 while decompressing data: inconsistent stream state #47

Closed
lilyliu-love opened this issue Oct 27, 2017 · 2 comments · Fixed by #25
Closed

zlib.error: Error -2 while decompressing data: inconsistent stream state #47

lilyliu-love opened this issue Oct 27, 2017 · 2 comments · Fixed by #25

Comments

@lilyliu-love
Copy link

Hello, I`m sorry to trouble u , but I met a error that I can not solve when I run the demo according to the README file. And I can not find the same problem on the internet either.
screenshot from 2017-10-27 14-47-15

@mingrui
Copy link

mingrui commented Nov 14, 2017

I have exact same problem:

Using TensorFlow backend.
function(): fetch training data files
Reading: /media/mingrui/960EVO/workspace/3DUnetCNN/brats/brats/data/HGG/brats_2013_pat0001_1/T1.nii.gz
Traceback (most recent call last):
  File "brats/train.py", line 57, in <module>
    main(overwrite=True)
  File "brats/train.py", line 29, in main
    write_data_to_file(training_files, config["hdf5_file"], image_shape=config["image_shape"])
  File "/media/mingrui/960EVO/workspace/3DUnetCNN/unet3d/data.py", line 55, in write_data_to_file
    crop_slices, affine, header = find_downsized_info(training_data_files, image_shape)
  File "/media/mingrui/960EVO/workspace/3DUnetCNN/unet3d/normalize.py", line 9, in find_downsized_info
    foreground = get_complete_foreground(training_data_files)
  File "/media/mingrui/960EVO/workspace/3DUnetCNN/unet3d/normalize.py", line 18, in get_complete_foreground
    subject_foreground = get_foreground_from_set_of_files(set_of_files)
  File "/media/mingrui/960EVO/workspace/3DUnetCNN/unet3d/normalize.py", line 29, in get_foreground_from_set_of_files
    image = read_image(image_file)
  File "/media/mingrui/960EVO/workspace/3DUnetCNN/unet3d/utils/utils.py", line 47, in read_image
    image = fix_shape(nib.load(in_file))
  File "/home/mingrui/anaconda3/envs/p3_fastai/lib/python3.6/site-packages/nibabel/loadsave.py", line 43, in load
    is_valid, sniff = image_klass.path_maybe_image(filename, sniff)
  File "/home/mingrui/anaconda3/envs/p3_fastai/lib/python3.6/site-packages/nibabel/filebasedimages.py", line 514, in path_maybe_image
    sniff)
  File "/home/mingrui/anaconda3/envs/p3_fastai/lib/python3.6/site-packages/nibabel/filebasedimages.py", line 462, in _sniff_meta_for
    binaryblock = fobj.read(sniff_nbytes)
  File "/home/mingrui/anaconda3/envs/p3_fastai/lib/python3.6/site-packages/nibabel/openers.py", line 168, in read
    return self.fobj.read(*args, **kwargs)
  File "/home/mingrui/anaconda3/envs/p3_fastai/lib/python3.6/gzip.py", line 276, in read
    return self._buffer.read(size)
  File "/home/mingrui/anaconda3/envs/p3_fastai/lib/python3.6/_compression.py", line 68, in readinto
    data = self.read(len(byte_view))
  File "/home/mingrui/anaconda3/envs/p3_fastai/lib/python3.6/gzip.py", line 471, in read
    uncompress = self._decompressor.decompress(buf, size)
zlib.error: Error -2 while decompressing data: inconsistent stream state
Closing remaining open files:/media/mingrui/960EVO/workspace/3DUnetCNN/brats/data.hdf5...done

what version of python are you using?
I am using python 3.6.3

@mingrui
Copy link

mingrui commented Nov 14, 2017

use python 2 will solve this issue

ellisdg added a commit that referenced this issue Nov 18, 2017
1) Uses SimpleITK if N4BiasFieldCorrection cannot be found by nipype (closes #52 & closes #32).
2) Adds predict.py file that uses the trained model and writes the predicted labels to file (closes #51). The predictions are now multi-label (closes #41 & closes #36).
3) Fixes relative import (closes #49).
4) Removes "pickable" flag from training which fixes and closes #47.
5) Adds batch normalization option (closes #39).
6) Adds option to use patch training. This is will substantially reduce the memory requirement for training.
7) Updates README. Links to data that do not require registration (closes #37).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants