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

can't pickle tensorflow #529

Closed
ghost opened this issue Sep 17, 2020 · 4 comments
Closed

can't pickle tensorflow #529

ghost opened this issue Sep 17, 2020 · 4 comments

Comments

@ghost
Copy link

ghost commented Sep 17, 2020

I have tried the main repository, and i get the error that "self" is not defined. There was an issue about this, so i used the branch from that fix. Now i am getting:
raceback (most recent call last):
File "demo_cli.py", line 93, in
mels = synthesizer.synthesize_spectrograms(texts, embeds)
File "D:\RealTimeDeepFake\voice\Real-Time-Voice-Cloning\Real-Time-Voice-Cloning\synthesizer\inference.py", line 101, in synthesize_spectrograms
[(self.checkpoint_fpath, embeddings, texts, self._seed)])[0]
File "C:\Users\fnafm\AppData\Local\Programs\Python\Python37\lib\site-packages\multiprocess\pool.py", line 276, in starmap
return self._map_async(func, iterable, starmapstar, chunksize).get()
File "C:\Users\fnafm\AppData\Local\Programs\Python\Python37\lib\site-packages\multiprocess\pool.py", line 657, in get
raise self._value
multiprocess.pool.MaybeEncodingError: Error sending result: '<multiprocess.pool.ExceptionWithTraceback object at 0x00000250FDB07DC8>'. Reason: 'TypeError("can't pickle tensorflow_core.python._tf_stack.Stack objects")'

I have tried using conda environment with python 3.7, and also, plain python, following this procedure : https://poorlydocumented.com/2019/11/installing-corentinjs-real-time-voice-cloning-project-on-windows-10-from-scratch/

My hardware really sucks and i can't run linux. I am stuck with live sessions and windows.
How can i fix the issue?

@ghost
Copy link

ghost commented Sep 17, 2020

Hi @AntINFINAit , thank you for reporting this issue. As a workaround, remove the seed argument from this line:

model = Tacotron2(checkpoint_fpath, hparams, seed=self._seed)

That is, change it to:

model = Tacotron2(checkpoint_fpath, hparams) 

You will be not have the ability to force deterministic synthesis, but at least it should run. If you need that feature, try the 423_add_cpu_mode branch of my fork, and change the --low_mem argument to --cpu.

@ghost
Copy link
Author

ghost commented Sep 17, 2020

The issue is that "self" does not appear to be referenced in this python. That is why i used your other branch. How can i fix that error?

@ghost
Copy link

ghost commented Sep 17, 2020

I should have been a little more clear, you should be able to make the above change on Corentin's master and it should also resolve the "self" issue by not referencing it.

Since you're using my fork as the starting point, try replacing seed=self._seed with seed=None in this line:
https://github.com/blue-fish/Real-Time-Voice-Cloning/blob/8e4a0565544d0ae6ee3d22518961a28ed88eba5e/synthesizer/inference.py#L100-L101

If that doesn't work then try the CPU mode since that bypasses the low_mem code that is giving you issues.

@ghost
Copy link

ghost commented Sep 23, 2020

@AntINFINAit Are you still experiencing this problem?

@ghost ghost closed this as completed Sep 23, 2020
ghost pushed a commit that referenced this issue Sep 30, 2020
* For low_mem, use spawned workers instead of forked workers (resolves #36)
Used implementation from @lilydjwg: #36 (comment)

* Different method of passing the seed for low_mem inference
Resolves #491, #529, #535
This issue was closed.
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

0 participants