rish-16 / gpt2client

✍🏻 gpt2-client: Easy-to-use TensorFlow Wrapper for GPT-2 117M, 345M, 774M, and 1.5B Transformer Models 🤖 📝
MIT License
372 stars 74 forks source link

ModuleNotFoundError: No module named 'tensorflow.contrib' for tensorflow >= 2 #28

Closed BAHorobet closed 4 years ago

BAHorobet commented 4 years ago

It doesn't seem to work with TensorFlow 2. Is there an update coming soon for the package?


ModuleNotFoundError Traceback (most recent call last)

in ----> 1 from gpt2_client import GPT2Client ~\Anaconda3\envs\tensorflow-GPU\lib\site-packages\gpt2_client\__init__.py in ----> 1 from gpt2_client.gpt2_client import GPT2Client ~\Anaconda3\envs\tensorflow-GPU\lib\site-packages\gpt2_client\gpt2_client.py in 11 12 import tensorflow as tf ---> 13 from tensorflow.contrib.training import HParams 14 import numpy as np 15 import gpt_2_simple as gpt2 ModuleNotFoundError: No module named 'tensorflow.contrib'
codecrust commented 4 years ago

Install tensor flow 1.15 and it goes away. Tensorflow.contrib was removed in v2 onwards.

rish-16 commented 4 years ago

Hey, @BAHorobet

The package is Tensorflow 1.1X only. Unfortunately, with school and work, I haven't had to time to switch to TF2.0

BAHorobet commented 4 years ago

Thanks, guys.

I understand @rish-16, do you have it in plan to upgrade it to TF2.0? I can see that Tensorflow.contrib was removed but there must be an alternative.

rish-16 commented 4 years ago

@BAHorobet Yup, definitely! It's in the world. I'm slowly getting it done 😓

Appreciate your patience :)