openai / gpt-2

Code for the paper "Language Models are Unsupervised Multitask Learners"
https://openai.com/blog/better-language-models/
Other
22.57k stars 5.53k forks source link

Native Installation Leads to a "no attribute sort" error? #242

Open SarahSzabo opened 4 years ago

SarahSzabo commented 4 years ago

After following the instructions carefully in bash, for the native installation they inevitably lead to this error: AttributeError: module 'tensorflow' has no attribute 'sort'

I wrote a SO post about it here which has the full stack trace: https://stackoverflow.com/questions/61510865/tensorflow-has-no-attribute-sort-in-gpt-2-git-release

What should I do to have a successful install and resolve this issue?

mcenderdragon commented 4 years ago

After way too much debugging I found the solution for this! Update Tensorflow. Replacing the docker image did fix it for me https://github.com/openai/gpt-2/blob/master/Dockerfile.cpu#L1. So just use FROM tensorflow/tensorflow:1.15.0-py3 instaed and it should work. It is important to not update to tensorflow 2.2