gpt-2
gpt-2 copied to clipboard
ModuleNotFoundError when training the model
Hi guys, I am working on finetuning a GPT-2 in Google Collab to use in (behavioral) research, but I am very new to this and I don't understand what's going on. I have been using it without errors for a few weeks now, but now the algorithm does not cooperate with me anymore lol :)
Traceback (most recent call last):
File "./train.py", line 14, in
I've tried to import tensorflow.contrib manually (import tensorflow.contrib) but it does not solve the problem. Also, I have tried to see which tensorflow was installed, uninstalled and reinstalled newer versions but it still does not work.
Can someone please help me? Thanks so much. If needed, here is the google collab link:
Cheers, Marloes
I have this issue too. It's preventing me from using GPT-2 in my implementation whatsoever. Some sources show a solution as using Tensorflow 1.x, but this also doesn't seem to work.
Getting the same error.
The same.
Hi guys! I solved it for my code by the following, try to install the correct tensorflow version (if this does not work, first uninstall tensorflow)
!pip install tensorflow==1.15
!pip install tensorflow-gpu==1.15
!pip install 'tensorflow-estimator<1.15.0rc0,>=1.14.0rc0' --force-reinstall
I placed these lines of code before
!pip3 install -r requirements.txt
and after installing the requirements
from google.colab import files
Hopefully it works for you guys! You can check out an example here: https://github.com/marloeshagens/GPT-2 or here as a notebook link: https://colab.research.google.com/gist/marloeshagens/4a0f72d6acd8a5bdd2d40a713497d280/dishonesty-updated-copy-of-gpt-2_medium_model.ipynb
Thanks you all, Marl.
On Fri, Jun 12, 2020, 2:41 PM marloeshagens [email protected] wrote:
Hi guys! I solved it for my code by the following, try to install the correct tensorflow version (if this does not work, first uninstall tensorflow)
!pip install tensorflow==1.15 !pip install tensorflow-gpu==1.15 !pip install 'tensorflow-estimator<1.15.0rc0,>=1.14.0rc0' --force-reinstall
I placed these lines of code before !pip3 install -r requirements.txt and after installing the requirements from google.colab import files
Hopefully it works for you guys! You can check out an example here: https://github.com/marloeshagens/GPT-2 or here as a notebook link: https://colab.research.google.com/gist/marloeshagens/4a0f72d6acd8a5bdd2d40a713497d280/dishonesty-updated-copy-of-gpt-2_medium_model.ipynb
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/openai/gpt-2/issues/238#issuecomment-643123602, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEYAMLZGCBEGAYKO5TZTZL3RWHL3DANCNFSM4LOUDFOQ .
As I work with GPT all the time doing inference and training I can't help but be curious for what behavioral research GPT is useful to you and how you use it. @marloeshagens
@jochemstoel thanks for the interest! I trained GPT-2 on texts written by humans that gave advice in a behavioral economic experiment. Eventually we will use these two different sources to see if there's any difference in the advice-taking, without using deception of who created the advice. If you are more interested, you can check out our Open Science Framework project page with all the preregistrations and some more explanations: https://osf.io/g3sw2/