Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tensorflow 2.5.3 not works #13

Open
zwx8981 opened this issue Feb 16, 2022 · 2 comments
Open

Tensorflow 2.5.3 not works #13

zwx8981 opened this issue Feb 16, 2022 · 2 comments

Comments

@zwx8981
Copy link

zwx8981 commented Feb 16, 2022

python main.py --lip_model_path models/lrs2_lip_model
2022-02-16 17:28:19.165150: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Successfully opened dynamic library libcudart.so.11.0
Traceback (most recent call last):
File "main.py", line 13, in
from language_model.char_rnn_lm import CharRnnLmWrapperSingleton
File "/home/redpanda/codebase/deep_lip_reading-dependabot-pip-tensorflow-gpu-2.5.3/language_model/char_rnn_lm.py", line 27, in
from tensorflow.contrib import legacy_seq2seq
ModuleNotFoundError: No module named 'tensorflow.contrib'

It seems that this module has been removed from Tensorflow2.5.3.

@TelphIsSleepy
Copy link

TelphIsSleepy commented Mar 16, 2022

hey there i ran into the problem today, when I was trying to use code connecting to gpt-2 that worked fine a month ago, and i got here from looking up this problem and seeing your post in solveforums as the only thing that references the problem that i could find. It's crazy that this update to tensor flow that happened on february 2 makes everyone trying to connect to gpt-2 have to change their code, and there's literally no resources online anywhere i could find that could help fix it, not even from open source ai instructing you how to use gpt-2. This update that released the newest version of tensorflow literally messes with my pip install tensorflow==1.15 and makes my code trying to install an older version that worked fine a month ago no longer work.

not sure if this is the best way to do it, but this is the way i got it to work, so i'm not messing with it regardless of how unoptimized this is. I was using google colab for this:

!pip install tensorflow==2.6 # (then restart run time in google colab)
from tensorflow.python.profiler import trace
!pip install tensorflow==1.15 #(this basically tricks tensorflow to get traceback from tensorflow2.6, but keeps the tensorflow.contrib from 1.15) # (then restart run time in google colab)
!pip install gpt2-client #(this messes with some files in tensorflow, but required tensorflow in order to install, so you need to do all the nonsense above to reinstall tensor flow again) # (then restart run time in google colab)
!pip install tensorflow==2.6 # (then restart run time in google colab)
from tensorflow.python.profiler import trace
!pip install tensorflow==1.15 # (then restart run time in google colab)

hope this helps!

@InterStella0
Copy link

InterStella0 commented Aug 10, 2022

For people who are looking for a solution to this. After doing some digging, legacy_seq2seq is an old tensorflow code that is only available on the v1.x. If you wanna run it in v2, you would need to migrate plenty of the code in this repo. For example, legacy_seq2seq is on the tensorflow_addons which is named seq2seq. And the respective models available on the module should be used.

If you wanna downgrade according to the requirement.txt for tensorflow, you would need python <= 3.6 for it to work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants