question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

_pickle.UnpicklingError: pickle data was truncated for loading CIFAR100

See original GitHub issue

Hello Guys,

I am trying to load CIFAR100 using cifar100.load_data() using keras. But I am encountering an error which says:

Using TensorFlow backend.
Traceback (most recent call last):
  File "resnet_cifar_new100.py", line 52, in <module>
    (x_train, y_train), (x_test, y_test) = cifar100.load_data()
  File "/home/bansa01/anaconda3/envs/keras/lib/python3.6/site-packages/keras/datasets/cifar100.py", line 34, in load_data
    x_train, y_train = load_batch(fpath, label_key=label_mode + '_labels')
  File "/home/bansa01/anaconda3/envs/keras/lib/python3.6/site-packages/keras/datasets/cifar.py", line 27, in load_batch
    d = cPickle.load(f, encoding='bytes')
_pickle.UnpicklingError: pickle data was truncated

I have made no changes whatsoever in the respective file. And the version of Keras and Tensorflow I am using are:

(keras) bansa01@vita2:/ssd2/home/bansa01/resnet_final/tmp_spectral_new$ python -c 'import keras; print(keras.__version__)'
Using TensorFlow backend.

2.2.4

(keras) bansa01@vita2:/ssd2/home/bansa01/resnet_final/tmp_spectral_new$ python -c 'import tensorflow; print(tensorflow.__version__)'

1.11.0

Please suggest what should be done.

Regards Nitin

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
carloshdez90commented, Apr 23, 2019

I had the same error, try with this https://stackoverflow.com/a/52496786 it worked for me.

0reactions
SGQ-pycommented, Oct 13, 2020

Thank you for your reply, it helped me.

| | wxxd | | 17806259143@163.com | 签名由网易邮箱大师定制 On 10/8/2020 21:55,AminJunnotifications@github.com wrote:

For me the @xscharlie did work. The issue was that the downloaded files were broken, so it couldn’t load it. Erased them and downloaded them again and it worked. But I guess since it didn’t work for @AayushTyagi1 , the issue still remains open.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Python 3 keras: UnpicklingError: pickle data was truncated for ...
I need some help to fix my errors. I tried to load the cifar10 dataset and it wasn't able ...
Read more >
Loading big Doc2Vec model with error UnpicklingError
I ran into Error of UnpicklingError: pickle data was truncated when loading the model. Do you know what the issue here is and...
Read more >
_pickle.UnpicklingError: pickle data was truncated? - PyTorch ...
Could you redownload or recreate the data as it seems the file is not complete (truncated). Is there any other possible cause of...
Read more >
Python 3 Keras: Unpicklingerror: Pickle Data Was Truncated ...
I tested the "UnpicklingError: pickle data was truncated" error solution. Python reported an error when using pickle deserialization: data It is truncated ...
Read more >
TensorFlow KR | 안녕하세요, 혹시 동일한 문제가 있으셨던
UnpicklingError : pickle data was truncated ... packages\tensorflow\python\keras\datasets\cifar100. ... d = cPickle.load(f, encoding='bytes')
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found