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

Is there a way to use gpt-2 with the newest tensorflow (2.4)? #277

Closed artiblaster closed 3 years ago

artiblaster commented 3 years ago

I tried and it didn't work.

I am having trouble installing tensorflow 1.12.0.

I am trying pip3 install tensorflow==1.12.0

Which returns: ERROR: Could not find a version that satisfies the requirement tensorflow==1.12.0 (from versions: 2.2.0rc1, 2.2.0rc2, 2.2.0rc3, 2.2.0rc4, 2.2.0, 2.2.1, 2.3.0rc0, 2.3.0rc1, 2.3.0rc2, 2.3.0, 2.3.1, 2.4.0rc0, 2.4.0rc1, 2.4.0rc2, 2.4.0rc3, 2.4.0rc4) ERROR: No matching distribution found for tensorflow==1.12.0

DaveXanatos commented 3 years ago

Here's the full response on how I got GPT-2 running with TF=1.13.1, on a Linux-based system. If you're running Windows or Apple, might not help...

Running GPT-2 with Tensorflow & 'GPT-2 Client'

Good luck!

artiblaster commented 3 years ago

Here's the full response on how I got GPT-2 running with TF=1.13.1, on a Linux-based system. If you're running Windows or Apple, might not help...

Running GPT-2 with Tensorflow & 'GPT-2 Client'

Good luck!

First i have to be able to install 1.13.1 or 1.12.0. How did you install 1.13.1?

rMazeiks commented 3 years ago

ERROR: Could not find a version that satisfies the requirement tensorflow==1.12.0

I got a similar error when trying to install with Python 3.8. I managed to get GPT-2 to work with Python 3.5 and TF 1.14.0.

First i have to be able to install 1.13.1 or 1.12.0

Version 1.12 will not work. Even though the instructions tell you to use 1.12, the scripts use features only available at later releases. For example, tf.sort is used, which is only available from v1.13.

Is there a way to use gpt-2 with the newest tensorflow (2.4)?

I haven't tried it myself, but you could take a look at https://github.com/akanyaani/gpt-2-tensorflow2.0

artiblaster commented 3 years ago

Thanks i'll try this!