textgenrnn
textgenrnn copied to clipboard
Error "multi_gpu_model" not found
Whenever I try to import textgenrnn, it gives me that error. I've tested it on colab, and it works fine there when I set it to tensorflow 1.x but throws the error in 2.x. But the latest version of textgenrnn doesn't support 1.x, so please fix this!
Hello, I had this error and was able to bypass by downgrading from TensorFlow 2.4.x to 2.3.2: pip3 install tensorflow==2.3.2
I'd very much like to use 2.4 with my project, but it always throws this error with it. Hope we can find a solution.
cannot import name 'multi_gpu_model' from 'keras.utils' it shows me this error
I just commented the import line for it is not used in the whole file.
I downgraded the tensorflow and keras (keras==2.3.0 tensorflow-gpu==2.3.2) with python 3.7.9 and it works fine now ..!
This is still an issue and there is no tensorflow 2.3.x for python3.9 (on pypi) and for example Debian only packages python3.9 in their upcoming release.
I got the same error on python 3.82 I tried downgrading to tensorflow==2.3.2 but now I got this other error: "AttributeError: module 'tensorflow.compat.v2' has no attribute 'internal'" Did anyone got it working on 3.8?
Ok. Everything solved for me once I installed directly from the github repo: pip3 install git+git://github.com/minimaxir/textgenrnn.git
I just commented the import line for it is not used in the whole file.
Yeah but isnt the error occur when we import textgenrnn?
Ok. Everything solved for me once I installed directly from the github repo: pip3 install git+git://github.com/minimaxir/textgenrnn.git
OH MAN, i love you <3 It work fine to me
I was pinged about this issue so I set the Colab notebook to the workaround noted.
Not entirely sure if there's an easy fix because dependency issues are unfun.
I was pinged about this issue so I set the Colab notebook to the workaround noted.
Not entirely sure if there's an easy fix because dependency issues are unfun.
Not sure if I'm being an idiot or not as I don't know how pip actually works, but the version currently on GitHub works fine (at least for me and presumably everyone else celebrating on @fernaoguerra's comment) which is more recent (April 2020) than the version currently available on PyPI/pip (Feb 2020) so is the solution simply not to make the most current version on GitHub the one that installs through pip?
The multi_gpu_model import was removed in current master so installing from source works fine.
Looks like it was moved to its own utils
updating the published version in pip would solve this going forward, if the project had CI this could have been caught before publishing a non-working version
Usually, it is not advised to edit the module itself.
But you need to edit the module itself and change the multi_gpu_module and set_session import lines to these
from tensorflow.python.keras.utils.multi_gpu_utils import multi_gpu_model
from keras.backend import set_session
Though, the changes should be done to the module in a PR and new update should be released to PyPI
这是来自QQ邮箱的假期自动回复邮件。你好,邮件已收到,尽快回复。
Tensorflow sucks ass. Someone needs to fix it. Tensorflow, not textgenrnn.
Ok. Everything solved for me once I installed directly from the github repo: pip3 install git+git://github.com/minimaxir/textgenrnn.git
Thank you!
In Google Colab I had to do this a little different:
!pip3 install textgenrnn@git+https://github.com/minimaxir/textgenrnn.git@master
这是来自QQ邮箱的假期自动回复邮件。你好,邮件已收到,尽快回复。
Hello, has anyone had this issue again recently and resolved it? tensorflow==2.3.2 is deprecated, installing directly from git isn't working, and updating tensorflow + keras also did not work out for me
这是来自QQ邮箱的假期自动回复邮件。你好,邮件已收到,尽快回复。
There's an easy fix, if you don't mind losing multi gpu compatibility. Look for where it's looking for multi_gpu_model.py, and make a .py file with a comment in it, there, to hide that error, because it find what it's looking for. I am just training on CPU, and none of my boards support more than one GPU, so that's what I do.
What python and tensorflow version are you using? I have the problem, that it seems to get worse with newer python/cuda/tensorflow versions to get it to run and currently I use a virtual environment with outdated libraries which may even stop working with python 3.11 and later versions.
any updates on this? what needs to be changed in google colab notebook to bypass these errors?
I know I should share my changes, but I made a fork of textgenrnn, and put my changes in it.
On Fri, Apr 28, 2023 at 6:43 AM jasmine rose federer < @.***> wrote:
any updates on this? what needs to be changed in google colab notebook to bypass these errors?
— Reply to this email directly, view it on GitHub https://github.com/minimaxir/textgenrnn/issues/222#issuecomment-1527675165, or unsubscribe https://github.com/notifications/unsubscribe-auth/AXC4XQ5DBF55YZKTOUCQWP3XDPJQVANCNFSM4VPZFNDQ . You are receiving this because you commented.Message ID: @.***>
No idea what you'd need to change in colab.
On Fri, Apr 28, 2023 at 12:03 PM A Fujioka @.***> wrote:
I know I should share my changes, but I made a fork of textgenrnn, and put my changes in it.
On Fri, Apr 28, 2023 at 6:43 AM jasmine rose federer < @.***> wrote:
any updates on this? what needs to be changed in google colab notebook to bypass these errors?
— Reply to this email directly, view it on GitHub https://github.com/minimaxir/textgenrnn/issues/222#issuecomment-1527675165, or unsubscribe https://github.com/notifications/unsubscribe-auth/AXC4XQ5DBF55YZKTOUCQWP3XDPJQVANCNFSM4VPZFNDQ . You are receiving this because you commented.Message ID: @.***>