Skip to content

module '_pickle' has no attribute 'HIGHEST_PROTOCOL' #53

Closed
@helga-lvl

Description

@helga-lvl

Hey!

I was running the model (on Python 3.7.3) with around 200 megabytes of data. After 11 hours and 10 epochs of training, I got the following message:

  rval = inputs[0].__getitem__(inputs[1:])
Total number of training labels: 9985024
Total number of validation labels: 1248128
Validation perplexity is 1.1226
Traceback (most recent call last):
  File "main.py", line 210, in <module>
    net.save(model_file_name, gsums=gsums, learning_rate=learning_rate, validation_ppl_history=validation_ppl_history, best_validation_ppl=best_ppl, epoch=epoch, random_state=rng.get_state())
  File "/home/Projects/punctuator2-master/models.py", line 252, in save
    cPickle.dump(state, f, protocol=cPickle.HIGHEST_PROTOCOL)
AttributeError: module '_pickle' has no attribute 'HIGHEST_PROTOCOL'

Then I decided to see what the next step would give me and I got:

cat terrafoldernormallt/unurlnorm.dev.txt | python punctuator.py Model_models.py_h256_lr0.02.pcl model_output.pcl


Loading model parameters...
Traceback (most recent call last):
  File "punctuator.py", line 149, in <module>
    net, _ = models.load(model_file, 1, x)
  File "/home/Projects/punctuator2-master/models.py", line 63, in load
    state = cPickle.load(f, **cpickle_options)
EOFError: Ran out of input

Any help would be greatly appreciated, thanks!

Activity

AASHISHAG

AASHISHAG commented on Apr 9, 2020

@AASHISHAG

@helga-lvl : How did you solve this issue? I'm also getting the same issue?

AttributeError: module '_pickle' has no attribute 'HIGHEST_PROTOCOL'

vjosapreniqi

vjosapreniqi commented on Jul 13, 2020

@vjosapreniqi

I have encountered the same exact problem, I was also running the model on Python 3.7. @ottokart Do you have any clue about this error?
@helga-lvl if you have already solved this problem, can you guide us on how you did it?

added a commit that references this issue on Jul 17, 2020

#53 fix - cPickle.HIGHEST_PROTOCOL incompatible with Python3

ottokart

ottokart commented on Jul 17, 2020

@ottokart
Owner

Punctuator2 was originally implemented in Python 2.7. Python3 no longer has the attribute HIGHEST_PROTOCOL so I removed it in the latest pushed commit: 8edec70

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      module '_pickle' has no attribute 'HIGHEST_PROTOCOL' · Issue #53 · ottokart/punctuator2